Library / SDK
react-bootstrap/react-router-bootstrap avatar
react-bootstrap/react-router-bootstrap

react-router-bootstrap: Linking React Bootstrap Components to React Router

Integration between React Router and React-Bootstrap

1,676 stars156 forksJavaScriptApache-2.0

At a glance

What is it?
react-router-bootstrap is a small JavaScript integration package that connects React Router navigation with React Bootstrap components. It is useful when Bootstrap controls need router-aware links, but it does not replace either library.
Who is it for?
Adopt react-router-bootstrap when a React Bootstrap component must use React Router navigation and the project already depends on React Router v6 and React. Do not choose it for routing logic, visual design, or React Router v4 and earlier compatibility without checking the corresponding branch.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository received new commits within the last day.
What is it written in?
Mainly JavaScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.

Editorial analysis

Installing the package for React Router v6

For a React Router v6 application, the README gives a single npm installation command. The command installs the package with `-S`, which records it as a dependency in the npm project configuration.

bash
npm install -S react-router-bootstrap

After installation, import `LinkContainer` from `react-router-bootstrap` in the file that renders the linked Bootstrap component. The package metadata declares `react` and `react-router-dom` as peer dependencies, so the application must already provide compatible versions. The package itself publishes its compiled code through the `lib` directory and declares `./lib/index.js` as its main entry point.

Older React Router versions use a different distribution line. The README documents `@rr-v4` for React Router v4 or v5, and `@rr-v3` for React Router v3 or lower. These are branch-specific choices rather than interchangeable configuration in one installation.

Creating a router-aware React Bootstrap button

The documented conversion is short. A normal React Bootstrap button can point at a URL with `href`, but that does not turn the button into a React Router link. Wrapping it in `LinkContainer` changes the integration point without replacing the React Bootstrap component.

The README first presents the ordinary Bootstrap markup:

js
<Button href="/foo/bar">Foo</Button>

It then presents the React Router-aware form:

js
import { LinkContainer } from 'react-router-bootstrap'
<LinkContainer to="/foo/bar">
  <Button>Foo</Button>
</LinkContainer>

The `to` property belongs on `LinkContainer`. The `<Button>` remains a React Bootstrap element and supplies the rendered control and its visible label. This composition keeps the button's presentation in React Bootstrap while assigning navigation behavior through the wrapper.

The README says that `LinkContainer` accepts the same parameters as React Router's `<NavLink>`. That is the clearest documented compatibility boundary. The README does not enumerate every supported prop, describe active-class behavior, or explain how conflicts between child props and router props are resolved. Developers should check those details against the version used by the application rather than infer them from the example.

Repository layout and build surface

Based on the repository layout, the package keeps source code in `src`, tests in `test`, and the package entry point in the generated `lib` directory. The `files` field in `package.json` limits published contents to `lib`, so consumers receive the compiled library entry point rather than the repository's source and development configuration.

The build script removes `lib`, runs a Webpack production build, and transpiles `src` into `lib` with Babel:

bash
npm run build

The script chain is declared as `rimraf lib && webpack-cli && npm run build-prod && babel src -d lib`. The repository also defines a separate production command:

bash
npm run build-prod

For contributors and maintainers, `npm test` runs linting and Jest tests. The `lint` script is `eslint src test *.js`, while the `tdd` script starts Jest in watch mode. These scripts describe a conventional JavaScript package workflow with linting, unit tests, Babel, and Webpack. They do not show that the package performs runtime routing or installs Bootstrap itself.

The package metadata includes development dependencies for React Bootstrap, Bootstrap, Babel, Jest, Enzyme, and Webpack tooling. These are development concerns. An application still needs its own React Router and React Bootstrap setup, along with the Bootstrap styling or components expected by its design.

Version constraints and upgrade work

Version selection is the first practical constraint for this project. The package metadata lists `react-router-dom` `>=6.0.0` as a peer dependency, while the README directs older React Router users to named branches. Consequently, upgrading the wrong branch can leave the application with an integration package that does not match its routing API.

The listed releases are `v0.26.3` on 2024-06-27, `v0.26.2` on 2022-07-11, and `v0.26.1` on 2022-03-11. The repository's last push was on 2026-10-15, and it is not archived. That supports treating the repository as recently changed, but the release history and peer dependency range should still be checked before adoption because the latest listed release is older than the last push.

The `0.x` package version is another concrete upgrade consideration. The README does not document a compatibility table for every React or React Router release, a migration guide between `0.26.x` releases, or a formal deprecation schedule. Developers should inspect the package version and its peer dependency requirements as part of any React Router upgrade.

The package is licensed under Apache-2.0. That license permits use and modification under its terms, but license obligations and compatibility with an application's distribution model are matters for the adopting organization to review. This review is not legal advice.

Choosing between LinkContainer and a plain link

A plain React Bootstrap `href` is sufficient when the application wants a conventional document navigation or when the target is outside the React Router route tree. Using `LinkContainer` is specifically relevant when the same visual control should participate in React Router navigation. The difference is not the button's appearance. It is how the destination is handled by the routing layer.

The alternative approach is to compose a React Router `<Link>` directly with a React Bootstrap component, if the application's component structure and React Router version support that composition. The documented value of `react-router-bootstrap` is that it supplies a purpose-built wrapper rather than requiring each screen to repeat its own integration pattern. Its scope is therefore narrower than a general routing abstraction, but that narrowness also limits its feature set.

The package is the wrong tool when the application does not use React Router, needs React Router v3 through v5 on the main package line, or expects utilities for route configuration, redirects, nested layouts, loaders, or authentication. The README and package metadata do not claim those capabilities.

Choosing adoption criteria for LinkContainer

The package fits a React application that already depends on React Router v6 and React Bootstrap, and that repeatedly needs Bootstrap controls to navigate within the router. The documented conversion is specific: keep `<Button>` as the visual component, place `LinkContainer` around it, and provide the destination through `to`.

It does not fit projects that need a complete navigation system. A plain React Router `<Link>` or a direct application-specific wrapper may be more appropriate when the integration requirements extend beyond the parameters shared with `<NavLink>`. The repository lists source, tests, build configuration, and contributing files, but the README does not document route matching, active state handling, accessible keyboard behavior, or server-side rendering behavior for `LinkContainer`.

The first checks should be the current package version, the installed `react` and `react-router-dom` versions, and the expected behavior of `LinkContainer` in the specific React Router release. If those checks match, the package offers a focused way to connect React Bootstrap controls to client-side routing without replacing either dependency.

Editorial conclusion

Adopt react-router-bootstrap when a React Bootstrap component must use React Router navigation and the project already depends on React Router v6 and React. Do not choose it for routing logic, visual design, or React Router v4 and earlier compatibility without checking the corresponding branch. Verify the installed package version, the required peer dependencies, and whether LinkContainer matches the navigation behavior your application expects.

Frequently asked questions

How do I install react-router-bootstrap for React Router v6?

Run `npm install -S react-router-bootstrap`. The README identifies this installation path for React Router v6, and package metadata declares `react-router-dom` `>=6.0.0` as a peer dependency.

How do I make a React Bootstrap Button use React Router navigation?

Wrap the `Button` in `LinkContainer` and pass the destination with `to`. The documented pattern is `<LinkContainer to="/foo/bar"><Button>Foo</Button></LinkContainer>`.

Can I use react-router-bootstrap with React Router v4 or v5?

The README directs React Router v4 and v5 users to the `rr-v4` branch and names the installation package `react-router-bootstrap@rr-v4`. The main package metadata targets `react-router-dom` `>=6.0.0`.

Does react-router-bootstrap provide routing and Bootstrap components itself?

No. The package is an integration layer between React Router and React Bootstrap. It provides `LinkContainer`, while route configuration remains with React Router and rendered controls such as `Button` remain with React Bootstrap.

What license does react-router-bootstrap use?

The repository package metadata lists `Apache-2.0` as the license.

Official sources

  1. Issues
  2. License: Apache-2.0
  3. react-bootstrap/react-router-bootstrap on GitHub
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/react-bootstrap-react-router-bootstrap.svg)](https://hysenlabs.com/projects/react-bootstrap-react-router-bootstrap)

Was this useful?