-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Description
I started a new pet project setting up webpack for react in order to understand the working of webpack better, my aim was to set up server side rendering and client rendering
while in development mode is working fine however in production mode I get an error rendering the React element on server side
Invariant failed: You should not use Route outside a < Router >
It must be something related to webpack optimizing the code , but i am not able to pin point it
React router 4.2.0 is working fine , however with react router 5.0.0 is not working. I tried other solutions like
using only react router
importing static router from react-router import {StaticRouter} from "react-router"
but nothing worked, I have set up a repo on github
Version
5.0.0
Test Case
https://github.com/RachitKalra/react-setup
Steps to reproduce
Just install the node dependencies and run npm debug for development mode and npm start for production mode ( causing the error )