What to do with react-router?
See original GitHub issueMany times I have problem with <Link ... />
and <Route ... />
maybe with something like:
<Route
path={`${match.url}/:player_id`}
children={props => (
<PlayerDetail {...props} teamId={match.params.team_id} />
)}
/>
Route
whyDidYouRender.min.js:1185 {Route: ƒ} "Re-rendered because of props changes:"
whyDidYouRender.min.js:1190 props.children
whyDidYouRender.min.js:1190 different functions with the same name.
whyDidYouRender.min.js:1190 {prev children: ƒ} "!==" {next children: ƒ}
Can we make a Wiki page (or you have already planned a future article) just for react-router
?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
Quick Start - React Router: Declarative Routing for React.js
To get started with React Router in a web app, you'll need a React web app. ... First, install create-react-app and make a...
Read more >A Brief Overview of React Router and Client-Side Routing
React Router is an API for React applications. Most current code is written with React Router 3, although version 4 has been released....
Read more >React Router - W3Schools
To add React Router in your application, run this in the terminal from the root ... If you are upgrading from v5, you...
Read more >How To Handle Routing in React Apps with React Router
In React, routers help create and navigate between the different URLs that make up your web application. They allow your user to move ......
Read more >Why Should You Use a Router in React.js? - Simplilearn
We will need to utilize Router in React JS to create a React application with navigation across multiple pages. React Router is a...
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 FreeTop 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
Top GitHub Comments
It seems a lot of very commonly used packages aren’t built with memoization in mind. I guess it’s fine, premature optimization and all that. Same is true for many things that say they play nicely with hooks, but then return a new function on every call (e.g. react-apollo-hooks).
That being said, what I did with react-router was to, yes, acknowledge that the components behave like that, and 2. use the global exclude feature to reduce noise.
Thats one way to go, but I still think this is not the right way to go. I think we should not usually care about why components render unless they are huge components that are bottlenecks and important to performance