Warnings when using react-router-config's renderRoutes()
See original GitHub issueVersion
react-router, react-router-config and react-router-dom are all in version 4.4.0-beta.1.
react and react-dom are at 16.5.2.
Steps to reproduce
entry:
render(<BrowserRouter>{renderRoutes(routes)}</BrowserRouter>, document.getElementById('root'))
If I replace only {renderRoutes(routes)} with <Root/>, warnings are not longer printed to the console.
routes being:
export default [
{
component: Root
}
]
Root
export class Root extends PureComponent {
render() {
return (
<h1>Root</h1>
)
}
}
Expected Behavior
Components are rendered without any warnings.
Actual Behavior
Warning: You should not be using this.context.router.history directly. It is private API for internal use only and is subject to change at any time. Instead, use a <Route> or withRouter() to access the current location, match, etc.
Warning: You should not be using this.context.router.location directly. It is private API for internal use only and is subject to change at any time. Instead, use a <Route> or withRouter() to access the current location, match, etc.
Warning: You should not be using this.context.router.match directly. It is private API for internal use only and is subject to change at any time. Instead, use a <Route> or withRouter() to access the current location, match, etc.
Warning: You should not be using this.context.router.staticContext directly. It is private API for internal use only and is subject to change at any time. Instead, use a <Route> or withRouter() to access the current location, match, etc.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Warnings when using react-router-config's renderRoutes()
It is private API for internal use only and is subject to change at any time. Instead, use a <Route> or withRouter() to...
Read more >react-router-config - npm
Static route config matching for React Router. ... Start using react-router-config in your project by running `npm i react-router-config`.
Read more >How to render NotFound Component react-router-config
Internally renderRoutes work like normal react-router <Switch {...switchProps}> { routes.map((route, i) => ( <Route key={route.key || i} ...
Read more >React Router - Route Config
React Router - Route Config. A simple example deployed using react-codesandboxer ... package.json. sandbox.config.json. Dependencies. react-router-dom^5.3.0.
Read more >How to use the react-router-config.renderRoutes function in ...
To help you get started, we've selected a few react-router-config.renderRoutes examples, based on popular ways it is used in public projects.
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

Hi @GeKorm, Yes, I confirm I get the message even running without any extensions. I can see the log
Download the React DevTools for a better development experience: https://fb.me/react-devtoolsin console.It appeared again… I have no idea what is causing this. I haven’t even installed anything. Even still, I tried
yarnand it didn’t solve the issue. I can’t share my project, however I will try to reproduce it on something I can share.