Skip to content

Exception with react-router v6: (0, _reactRouterDom.withRouter)(LinkContainer) is not a function #259

@bggolding

Description

@bggolding

I’m trying to use react-router-bootstrap with react-router v6 but I keep getting this error when the app starts.

LinkContainer.js:155 Uncaught TypeError: (0 , _reactRouterDom.withRouter) is not a function
    at Object../node_modules/react-router-bootstrap/lib/LinkContainer.js (LinkContainer.js:155)
    at __webpack_require__ (bootstrap:784)
    at fn (bootstrap:150)
    at Object../node_modules/react-router-bootstrap/lib/IndexLinkContainer.js (IndexLinkContainer.js:14)
    at __webpack_require__ (bootstrap:784)
    at fn (bootstrap:150)
    at Object../node_modules/react-router-bootstrap/lib/index.js (index.js:6)
    at __webpack_require__ (bootstrap:784)
    at fn (bootstrap:150)
    at Module../src/components/TopNavBar.js (TopNavBar.css?1017:45)
    at __webpack_require__ (bootstrap:784)
    at fn (bootstrap:150)
    at Module../src/app/App.js (App.css?56b3:45)
    at __webpack_require__ (bootstrap:784)
    at fn (bootstrap:150)
    at Module../src/index.js (index.css?f3f6:45)
    at __webpack_require__ (bootstrap:784)
    at fn (bootstrap:150)
    at Object.1 (version.js:2)
    at __webpack_require__ (bootstrap:784)
    at checkDeferredModules (bootstrap:45)
    at Array.webpackJsonpCallback [as push] (bootstrap:32)
    at main.chunk.js:1

I can’t work out how to fix this – can anyone give me some suggestions?

I’m using versions:

    "react-router": "^6.0.0-beta.0",
    "react-router-bootstrap": "^0.25.0",
    "react-router-dom": "^6.0.0-beta.0",

Thanks,

 Ben.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions