$ npx create-remix@latest pokedex-remix
? What type of app do you want to create?
> Just the basics
? Where do you want to deploy?
> Remix App Server
? TypeScript or JavaScript?
> TypeScript
? Do you want me to run `npm install`?
> Yes
$ cd ./pokedex-remix
$ npm run dev
npm run dev
Starts the app in dev mode with hot reload
npm run build
Creates a production build of your app (output in build and public/build folders)
npm start
Starts Node.js server in build folder
npm run typecheck
Runs TypeScript compiler to ensure type-safety in build pipeline (not done automatically by Remix compiler)
_index indicates an index route
→ URLs / and /blog
Static route segments
→ e.g. /about and/blog/archive
Use the dot delimiter for nested routes
→ URLs /blog/…
Dynamic route segments (parameters) start with a dollar symbol
→ e.g. /blog/five-great-tips-for-2024
blog.$slug.tsx
How can we redirect to a different route?
E.g. / → /blog
How can we redirect to a different route?
E.g. / → /blog
_index.tsx
Must be a named export called loader.
_index.tsx
→ redirects to blog.tsx
_index.tsx
pokemon._index.tsx
pokemon.$pokemonName.tsx
Complete solution code can be found on GitHub on the branch exercise-02-routing.
blog.$slug.tsx
blog.$slug.tsx
Return a Response object…
…or throw it!
fetcher.ts
pokemon._index.tsx
pokemon.$pokemonName.tsx
Complete solution code can be found on GitHub on the branch exercise-03-data-fetching.