Hacker News new | ask | show | jobs
by micahbule 1670 days ago
Yes, NextJS does ship with an imperative router, but you cannot construct a custom route on the client-side without adhering to the core concept of building your routes based on the pages directory.

I also agree that there's more to caching and SSG with NextJS. I'm simply stating some notable differences between NextJS and Remix, answering the top-most parent comment.

1 comments

> "you cannot construct a custom route on the client-side without adhering to the core concept of building your routes based on the pages directory."

Actually, that's not true. You can opt out of the fs-based routing altogether.

I'm not aware of said functionality on the client-side. Out of curiosity, do you mind linking me to said documentation or article on how to circumvent routing on the client-side without using fs-based routing?
https://nextjs.org/docs/advanced-features/custom-server#disa...

> "You may also wish to configure the client-side router to disallow client-side redirects to filename routes; for that refer to router.beforePopState."

https://nextjs.org/docs/api-reference/next/router#routerbefo...

That is through using a custom server -- which is a whole other topic. I'm comparing apples-to-apples between NextJS's built-in router and Remix's usage of React Router as far as client-side routing is concerned.