# Tutorial error step - Adding Links in the Navbar - step import { LinkContainer } from "react-router-bootstrap";

**URL:** <https://discourse.sst.dev/t/tutorial-error-step-adding-links-in-the-navbar-step-import-linkcontainer-from-react-router-bootstrap/897>\
**Category:** General\
**Created:** [March 18, 2019, 1:45am UTC](https://discourse.sst.dev/t/tutorial-error-step-adding-links-in-the-navbar-step-import-linkcontainer-from-react-router-bootstrap/897 "2019-03-18T01:45:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Crashmailman](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@Crashmailman](https://discourse.sst.dev/u/Crashmailman)\
**Post date:** [March 18, 2019, 1:45am UTC](https://discourse.sst.dev/t/tutorial-error-step-adding-links-in-the-navbar-step-import-linkcontainer-from-react-router-bootstrap/897/1 "2019-03-18T01:45:16Z")

</div>

Hi all , i love the Tutorals and have been teaching me to much, but once i got to  
Adding Links in the Navbar - step import { LinkContainer } from “react-router-bootstrap”;

and do npm start all i get is a website with errors

TypeError: Cannot read property ‘history’ of undefined

LinkContainer.render

C:/Users/Adam.Wolarczuk/Desktop/Projects/notes-app-client/node\_modules/react-router-bootstrap/lib/LinkContainer.js:147

there is more if you need them i would really like to continue 🙂

---

<div class="post-metadata">

**Author:** ![pete](https://avatars.discourse-cdn.com/v4/letter/p/3ab097/32.png) [@pete](https://discourse.sst.dev/u/pete)\
**Post date:** [March 20, 2019, 11:42am UTC](https://discourse.sst.dev/t/tutorial-error-step-adding-links-in-the-navbar-step-import-linkcontainer-from-react-router-bootstrap/897/2 "2019-03-20T11:42:38Z")

</div>

I had the same issue, it comes from a change in react-router-dom.  
To get around it import **withRouter** from react-router-dom, and use it to wrap the LinkContainer components.

So I created a separate component in RoutedLinkContainer.js.

```auto
import React from "react";
import { LinkContainer } from "react-router-bootstrap";
import { NavItem } from "react-bootstrap";
import { withRouter } from "react-router-dom";

function RoutedLinkContainer(props) {
  return (
    <LinkContainer to={props.link}>
      <NavItem>{props.displayText}</NavItem>
    </LinkContainer>
  );
}

export default withRouter(RoutedLinkContainer);

```

In **App.js** import RoutedLinkContainer at the top, and replace the lines:

```auto
    <LinkContainer to="/signup"><NavItem>Signup</NavItem></LinkContainer>
    <LinkContainer to="/login"><NavItem>Login</NavItem></LinkContainer>

```

with:

```auto
    <RoutedLinkContainer link="/signup" displayText="Signup" />
    <RoutedLinkContainer link="/login" displayText="Login" />

```

---

<div class="post-metadata">

**Author:** ![jayair](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/jayair/32/9_2.png) [@jayair](https://discourse.sst.dev/u/jayair)\
**Post date:** [March 22, 2019, 4:57pm UTC](https://discourse.sst.dev/t/tutorial-error-step-adding-links-in-the-navbar-step-import-linkcontainer-from-react-router-bootstrap/897/3 "2019-03-22T16:57:28Z")

</div>

Thanks for helping out @pete!

It looks like the react-router-bootstrap guys are going to push out a fix for this soon - [https://github.com/react-bootstrap/react-router-bootstrap/pull/248](https://github.com/react-bootstrap/react-router-bootstrap/pull/248).

---

<div class="post-metadata">

**Author:** ![jayair](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/jayair/32/9_2.png) [@jayair](https://discourse.sst.dev/u/jayair)\
**Post date:** [March 22, 2019, 5:25pm UTC](https://discourse.sst.dev/t/tutorial-error-step-adding-links-in-the-navbar-step-import-linkcontainer-from-react-router-bootstrap/897/4 "2019-03-22T17:25:53Z")

</div>

For now I edited the guide to stick to react-router 4.3.1 while a fix is rolled out.

> <https://github.com/AnomalyInnovations/serverless-stack-com/commit/2b47be4ceca312503fa85a8c5f85098be747f86d>
