new react-router applyRouterMiddleware method
See original GitHub issueHi,
Just wondering, how the code would be changed with the new applyRouterMiddleware method from react-router.
Currently in the example we have
<Router render={(props) => <ReduxAsyncConnect {...props}/>} history={browserHistory}>
Thinking we should have something like
function useReduxConnect() { return { renderRouterContext: (child, props) => ( <ReduxAsyncConnect {...props} /> ) }; }
and then
<Router render={applyRouterMiddleware(useReduxConnect()} />} history={browserHistory}>
But not really sure.
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Top 5 react-router Code Examples - Snyk
To help you get started, we've selected a few react-router examples, based on popular ways it is used in public projects. Secure your...
Read more >React router scrolls new page down - Stack Overflow
React Router does not include scroll state management starting in version 2.0.0. The recommended approach is to decorate the router with ...
Read more >useHistory hook - React Router: Declarative Routing for React.js
The useLocation hook returns the location object that represents the current URL. You can think about it like a useState that returns a...
Read more >JavaScript react-router applyRouterMiddleware Examples
JavaScript applyRouterMiddleware - 6 examples found. These are the top rated real world JavaScript examples of react-router.applyRouterMiddleware extracted ...
Read more >Ultimate React Router v6 Guide
In our case we obviously want to render the /books/new route so React Router will select that route for us. The actual way...
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
I’ll add tests & example, you can track progress here:
https://github.com/makeomatic/redux-connect/tree/feat/applyRouterMiddleware
Copying here for lazy people:
@mmahalwy this looks pretty good without any need to handle
{child}
. I will try to get some code in to get this use-case working as well, but if not - this solution does work