Questions tagged [react-router-bootstrap]

This tag is for referring to issues involving the React Router Bootstrap component that connects to the React Router and React Bootstrap navigation items.

React Router is great at managing location state, and React Bootstrap is great at styling navigation but to connect them you typically use react-router-bootstrap which is not very well documented.

20 questions
4
votes
3 answers

SO react-router-bootstrap active link not working properly

I have a problem with active link using react-router-bootstrap (https://www.npmjs.com/package/react-router-bootstrap) components. When I navigate to About, active class appears not only on About but in Home too. Active Link react-router's issue This…
2
votes
0 answers

React-router-bootstrap: LinkContainer redirects url but doesn't rerender

I have a LinkContainer, that when clicked on, replaces the url of the webpage, but doesn't do anything beyond that. Nothing gets rerendered, the page just stays the same. Eg;
2
votes
1 answer

React router bootstrap LinkContainer returns TypeError: (0 , _reactRouterDom.withRouter) is not a function

It seems like since the recent update React had, everything related to the routing has been changed. I used to use LinkContainer from react-router-bootstrap but it's now throwing TypeError: (0 , _reactRouterDom.withRouter) is not a function. …
Laspeed
  • 791
  • 1
  • 5
  • 27
2
votes
1 answer

Error: Element type is invalid when using react-router-bootstrap LinkContainer

Using LinkContainer from react-router-bootstrap gives me this Error: Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. Check the render method of Header. …
2
votes
1 answer

Building navbar and I get this error Element type is invalid: expected a string (for built-in components) or a class/function for composite components

I'm building a navbar for a project and the above message is telling me to check the render method in my header component. I've tried everything I can think of, including looking through answers on here. Specifically, I tried moving the Header…
2
votes
0 answers

React App - The context `router` is marked as required in `LinkContainer`, but its value is `undefined`

When trying to run my React app I keep getting this error in the browser: TypeError: Cannot read property 'history' of undefined LinkContainer.js var href = this.context.router.history.createHref(typeof to === 'string' ? { The console shows this…
1
vote
1 answer

Test fails when using LinkContainer from react-router-bootstrap

So I am making a ReactJS app which includes reactstrap, react-router and react-router-bootstrap. The problem is that when I test components which contain LinkContainer, the following error occurs, making my unit tests fail: console.error…
Koby
  • 33
  • 1
  • 6
0
votes
2 answers

Is there a solution for LinkContainer component from react-router-bootstrap error?

So I am using the LinkContainer component from react-router-bootstrap to wrap my Nav.Link component from bootstrap. Please refer to the picture below for reference. // Snippet import {LinkContainer} from "react-router-bootstrap"; // Snippet …
0
votes
1 answer

react-router-bootstrap LinkContainer component fails with a TypeError (0 , _reactRouterDom.withRouter) is not a function

I have been using the LinkContainer from the react-router-bootstrap react library for a while but currently it is throwing this error when I import it: TypeError (0 , _reactRouterDom.withRouter) is not a function I have my very simple react…
0
votes
1 answer

navbar react router with bootstrap not working

I'm having a issue with react-router-bootstrap not working as intended and i can't figure out why (it's working on another project) The URL change when I click on navbar icon ("localhost:3000" for logo img for example) but its not finding the…
0
votes
1 answer

React-Router URL Causes Component Re-Mount (Re-Initialization with useEffect(..), []) on Link Click

I ran into an issue also mentioned here, React-Router re-mounts component on route change, but without any solutions. If I have a Link pointing to a URL managed by react-router (or react-router-bootstrap in my case), export default function…
gene b.
  • 10,512
  • 21
  • 115
  • 227
0
votes
1 answer

How to avoid hash sign in URL, using react-router-dom and react-router-bootstrap?

I'm using from react-router-dom for routing and Nav + LinkContainer from react-bootstrap + react-router-bootstrap for navigation: //... //...
0
votes
1 answer

React navigation bar menu item that opens in a new window

In my React app, I'm trying to add a navigation menu item that opens in a new browser window. I know this seems an odd approach, since it's not exactly navigation if it takes you to a new window. But the goal is to have the menu option appear on all…
Woodchuck
  • 3,869
  • 2
  • 39
  • 70
0
votes
2 answers

Uable to make a req from one server to another - "Error: Request failed with status code 401"

I am trying to make an api req from one server (localhost:3000) to another server(localhost:3001) but I am getting authentication error 401. Note:If I hard code the authentication token, I am able to make the request.This let me conclude that I am…
Kasid Khan
  • 639
  • 2
  • 8
  • 23
0
votes
0 answers

this.context.router is not defined

I have this code: render() { return (
1
2