-
Notifications
You must be signed in to change notification settings - Fork 164
Closed

Description
TypeError: Cannot read property 'history' of undefined
LinkContainer.render
C:/Users/dd/Projects/vv/vv-app/node_modules/react-router-bootstrap/lib/LinkContainer.js:96
Struggling with using react-bootstrap and react-router-bootstrap. I created a basic navbar but no matter what (tried many examples online using a const in a file and a Component itself) but I get that error. Please help
import React, { Component, PropTypes } from 'react';
import { Navbar, Nav, NavItem } from 'react-bootstrap';
import { LinkContainer } from 'react-router-bootstrap';
class MyNavBar extends Component {
constructor(props) {
super(props);
this.state = {
loggedIn: 1,
};
}
render() {
return (
<div>
<Navbar>
<Navbar.Header>
<Navbar.Brand>
<a href="/">My space</a>
</Navbar.Brand>
<Navbar.Toggle />
</Navbar.Header>
<Navbar.Collapse>
<Nav>
<LinkContainer to="/tips">
<NavItem>Tips</NavItem>
</LinkContainer>
<LinkContainer to="/url-to-link2">
<NavItem>Item 2</NavItem>
</LinkContainer>
</Nav>
</Navbar.Collapse>
</Navbar>
<div className="content">
{this.props.children}
</div>
</div>
);
}
}
export default MyNavBar;
Metadata
Metadata
Assignees
Labels
No labels