-
Notifications
You must be signed in to change notification settings - Fork 164
Description
I am using react-bootstrap and react-router in my React application. I installed react-router-bootstrap so I could use Nav.Item and LinkContainer for my routes. Originally when I set it all up I kept getting this error.
./node_modules/react-router-bootstrap/lib/LinkContainer.js
Module not found: Can't resolve 'react-router-dom' in '/Users/wuno/Dropbox/Hack/Devops/react/riverwalk-credit-web/node_modules/react-router-bootstrap/lib'
I left the computer alone for a bit came back and started up the server again, npm start
and it worked fine. At this point I decided to do some refactoring which broke it again giving me the same error as mentioned above. At this point I set everything back to the last working state and the error was still there.
I checked the node_modules directory and I do not see a react-router-dom
inside of the lib folder or where it is even referencing this. But when I check the repo on git there does seem to be a reference for the library inside of LinkContainer
.
I am thinking this must be a bug but this is my first time using any of these tools. All my experience is with react-native.
index.js
import { Router, Route } from 'react-router';
<Router>
<div>
<Navigation />
<Route exact path="/" component={HomeContainer} />
</div>
</Router>
Navigation
import { LinkContainer } from 'react-router-bootstrap';
<LinkContainer to="/">
<NavItem>Home</NavItem>
</LinkContainer>
Error
./node_modules/react-router-bootstrap/lib/LinkContainer.js
Module not found: Can't resolve 'react-router-dom' in '/Users/wuno/Dropbox/Hack/Devops/react/riverwalk-credit-web/node_modules/react-router-bootstrap/lib'