Skip to content

Instantly share code, notes, and snippets.

@itaditya
Created August 30, 2021 11:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itaditya/d5fbde1f460e13c29ea12faed7603cb6 to your computer and use it in GitHub Desktop.
Save itaditya/d5fbde1f460e13c29ea12faed7603cb6 to your computer and use it in GitHub Desktop.
Remix Router understanding

Remix treats nested routes files differently. Its not simply a flat list of routes. Take this example-

routes
  team
    index.js
    $username.js
  team.js
  • The outer team.js acts as a layout component and it will render for any /team/* routes. It has the option to render an Outlet component to decide where to render child route content.
  • The inner team/index.js only renders at /team.
  • The inner team/$username.js renders for /team/adi-1, /team/adi-2 etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment