Skip to content
This repository has been archived by the owner on Jul 19, 2019. It is now read-only.

'react-router' does not contain an export named 'IndexRoute' #331

Open
jcubic opened this issue Jan 6, 2018 · 6 comments
Open

'react-router' does not contain an export named 'IndexRoute' #331

jcubic opened this issue Jan 6, 2018 · 6 comments

Comments

@jcubic
Copy link

jcubic commented Jan 6, 2018

I'm using CreateReactApp and when I use:

import { Router, Route, hashHistory, IndexRoute } from 'react-router';

I've got error:

'react-router' does not contain an export named 'IndexRoute'

Does the api changed and tutorial is out of date?

@HansAndreManfredson
Copy link

HansAndreManfredson commented Jan 11, 2018

You can write instead of IndexRoute the following:
<Route path="/" component={App} >

@PhillipMwaniki
Copy link

@anklaa That will give a warning that the child routes are not going to be rendered.

@WilliamShoww
Copy link

'react-router' does not contain an export named 'Link'.
So what's instead of Link?

@MariuszWojcikDeveloper
Copy link

@WilliamShoww I believe Link was moved here:
import {Link} from 'react-router-dom';

@Salar-Suliman
Copy link

There is no browserHistory export in v4. If you're using v2/3, then you just need to install the correct version (npm install react-router@3). If you are using v4, you should read this section of the migration guide.

@skjaiswal1991
Copy link

please try to user Dom.
import { Router, Route, Link, browserHistory, IndexRoute } from 'react-router-dom';

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants