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 …


This content originally appeared on DEV Community and was authored by Alexandro Martinez

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:

AppLayout - Nextjs

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:

AppLayout - Nextjs

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:

useMatches

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.


This content originally appeared on DEV Community and was authored by Alexandro Martinez


Print Share Comment Cite Upload Translate Updates
APA

Alexandro Martinez | Sciencx (2022-03-26T17:24:44+00:00) 3 reasons why you should use Remix instead of Next.js. Retrieved from https://www.scien.cx/2022/03/26/3-reasons-why-you-should-use-remix-instead-of-next-js/

MLA
" » 3 reasons why you should use Remix instead of Next.js." Alexandro Martinez | Sciencx - Saturday March 26, 2022, https://www.scien.cx/2022/03/26/3-reasons-why-you-should-use-remix-instead-of-next-js/
HARVARD
Alexandro Martinez | Sciencx Saturday March 26, 2022 » 3 reasons why you should use Remix instead of Next.js., viewed ,<https://www.scien.cx/2022/03/26/3-reasons-why-you-should-use-remix-instead-of-next-js/>
VANCOUVER
Alexandro Martinez | Sciencx - » 3 reasons why you should use Remix instead of Next.js. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/03/26/3-reasons-why-you-should-use-remix-instead-of-next-js/
CHICAGO
" » 3 reasons why you should use Remix instead of Next.js." Alexandro Martinez | Sciencx - Accessed . https://www.scien.cx/2022/03/26/3-reasons-why-you-should-use-remix-instead-of-next-js/
IEEE
" » 3 reasons why you should use Remix instead of Next.js." Alexandro Martinez | Sciencx [Online]. Available: https://www.scien.cx/2022/03/26/3-reasons-why-you-should-use-remix-instead-of-next-js/. [Accessed: ]
rf:citation
» 3 reasons why you should use Remix instead of Next.js | Alexandro Martinez | Sciencx | https://www.scien.cx/2022/03/26/3-reasons-why-you-should-use-remix-instead-of-next-js/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.