question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Warnings when using react-router-config's renderRoutes()

See original GitHub issue

Version

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:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
luchoctcommented, Oct 22, 2018

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-devtools in console.

1reaction
arturosscommented, Oct 11, 2018

It appeared again… I have no idea what is causing this. I haven’t even installed anything. Even still, I tried yarn and it didn’t solve the issue. I can’t share my project, however I will try to reproduce it on something I can share.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found