Notes on Remix🔗
-
Every
.tsx
can export aloader
function- It’s good practice to move the logic in this function to a
[file].server.ts
in amodels
directory.
- It’s good practice to move the logic in this function to a
-
Every
.tsx
can also support anactio
-
File based routing works different to Next.js. You can the name of the file will correspond the route its on and will only render if it matches. This must be using in conjuction with the
Outlet
component -
Remix projects will have
.server
and.client
file extension names . These are not just naming conventions but also are hints to the Remix compiler to prevent server code leaking into client side code and vice versa. It can help with tree shaking.
References