Router is not defined

See original GitHub issue

Router is not exported as a property of ‘react-router’ anymore and this construction is not valid cause Router is ‘undefined’

import { Router, Route } from 'react-router'

render((
  <Router>
    <Route path="/" component={ App }>
      <Route path="page1" component={ Page1 }/>
      <Route path="page2" component={ Page2 }/>
      <Route path="page3" component={ Page3 }/>
    </Route>
  </Router>
), document.getElementById('app-container'));

What is the new way to use react-router? Thank you!

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
taioncommented, Nov 7, 2015

Our README does say: $ npm install history react-router@latest. This installs RC4.

0reactions
zaaathcommented, Nov 7, 2015

@taion thank you! my mistake

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix ReferenceError: router is not defined mistake?
There are two ways to define your routes in express. One is to use express app instance and other is to using express...
Read more >
Router is not defined · Issue #2484 · remix-run/react ... - GitHub
Router is not exported as a property of 'react-router' anymore and this construction is not valid cause Router is 'undefined'.
Read more >
routing problems using node and express : r/learnjavascript
new at this, I am trying to build a basic app just to figure it out. I keep getting the error: throw new...
Read more >
Node.js Handling invalid routes - GeeksforGeeks
Route for invalid routing should be placed at the last of all routes because routes are called in the order in which they...
Read more >
[Vue.js] Parameters of router are undefined. - Medium
There seems to be no mistake in the description of the router parameter itself, but there is a problem that the parameter is...
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