What is the purpose of `react-static-routes`
See original GitHub issueIs it just a convenience method? Would there be any adverse effects to using a raw <Switch>
component instead?
Edit: Which file has the source code for this import? I would like to read the source for myself.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:7 (7 by maintainers)
Top Results From Across the Web
StaticRouter - React Router: Declarative Routing for React.js
A <Router> that never changes location. This can be useful in server-side rendering scenarios when the user isn't actually clicking around, so the...
Read more >Dynamic vs Static Routing in React | by Chameera Dulanga
In static routing, you need to define all the routes in a centralized location in your application. Then these routes will be imported...
Read more >Advantages of dynamic vs static routing in React
An advantage of static routing is that it allows for inspection and matching of routes before rendering. Hence it proves useful especially on ......
Read more >The Hitchhiker's Guide To React Router v4 - freeCodeCamp
React Router introduces a concept called “Dynamic Routing”, which is quite different from the “Static Routing” we are used to.
Read more >react-static-routing - npm
Static route for TypeScript, for TS lovers ♥!. Latest version: 1.3.2, last published: a year ago. Start using react-static-routing in your ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Sorry for not replying sooner I did solve this one, I had to delete react-static-routes out of node_modules and package.json otherwise it pulls in the wrong package, like @tannerlinsley suggests it’s a dynamically generated file per build not a module installed through npm.
In my case I incorrectly ran
npm i -S react-static-routes
without thinking much into it because my linter was complaining the package wasn’t listed.I think it may be worth noting in the docs somewhere.
I’m seeing this issue on react static 4.7.1, react router 1.0.0, macOS High Sierra 10.13.2
When I attempt to build it provides the same error
Error: Cannot find module 'react-static-routes'
My npm scripts look like this
start
continues to work as expected butbuild
is still giving the error after re-installing all the dependancies.I can see a
dist/react-static-routes.js
file is generated but all that’s innode_modules/react-static-routes
is a package.json file, is that normal?Let me know if you need any further info on this one.