Next.js Discord

Discord Forum

Getting 404 error when using react router dom instead of Next js in build routing system.

Answered
Miniature Pinscher posted this in #help-forum
Open in Discord
Miniature PinscherOP
I found my self using react router dom for routing instead of Next js routing system and i am getting a 404 error each time i reload the browser. I think its because of server side rendering, so the server can't access my route or something like that. How can i fix that? if possible without having to switch to Next js routing system
Answered by fuma
Impossible, Next.js handles all routing, you can't use anything else.
Why? You should stop using React Router since switched to Next.js.
View full answer

6 Replies

Impossible, Next.js handles all routing, you can't use anything else.
Why? You should stop using React Router since switched to Next.js.
Answer
If you wanna create SPA and use client side routing, use Vite instead of Next.js. Next.js is a framework that provides SSR functionality over React.js
lowkey I want SPA in my nextjs project
too deep in to go back now
@fuma Impossible, Next.js handles all routing, you can't use anything else. Why? You should stop using React Router since switched to Next.js.
Miniature PinscherOP
you are right, i swichted back to Next js App Router