An Interest In:
Web News this Week
- April 27, 2024
- April 26, 2024
- April 25, 2024
- April 24, 2024
- April 23, 2024
- April 22, 2024
- April 21, 2024
3 reasons why you should use Remix instead of Next.js
3 things that I came across this week:
1. Developer Experience
I tried migrating the React (Frontend only) to Next.js and I got tired, I built about 50-70% but I did not like all the workarounds I had to do, such as getLayout. I'm about to finish a Frontend AND Backend (previously with NET Core) version with Remix, and I learned about Remix last Saturday I think.
2. React Router / Layouts
Since Remix is built on top of react-router v6, I set up my application using multiple layouts. For example, I have 2 application layouts, AppLayout (/app) and AdminLayout (/admin). When migrating to Next.js, look at all the "AppLayout" occurrences:
Notice the 114 occurrences? And this is just for AppLayout, I have worked with many more layouts. I'm sure there's a better and cleaner way to do this, but I did not find it. That's part of the Developer Experience.
Now with Remix, 9 occurrences in 3 files:
3. State management
Instead of using redux to get the state, I can get it with useMatches. This is what my app loader looks like:
So I can access this data anywhere that starts with /app/* or /admin/* with the useMatches() hook, without spinners all over the page.
--
I'm going to give Next.js a try (again). But for now, I'm sticking with Remix.
Original Link: https://dev.to/alexandromtzg/3-reasons-why-you-should-use-remix-instead-of-nextjs-5554
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To