www/docs/migrating.mdx
React-Bootstrap v2 adds full compatibility with Bootstrap 5. Because Bootstrap 5 is a major rewrite of the project, there are significant breaking changes from React-Bootstrap v1.
PLEASE FIRST READ THE UPSTREAM BOOTSTRAP MIGRATION GUIDE
<DocLink path="/migration">View migration guide</DocLink>
React-Bootstrap only contains components that are present in vanilla Bootstrap. If functionality was removed from Bootstrap, then it was also removed from React-Bootstrap. This guide does not repeat information found in the upstream migration guide. Its goal is to document React-Bootstrap-specific API changes and additions.
We will continue to provide general maintenance for Bootstrap 4 components, because there are many projects that continue to depend on Bootstrap 4 support in react-bootstrap. react-bootstrap package versions will be as follows:
v1.0.0v1.0.0v2.0.0We are not committing to keeping breaking changes in lockstep with bootstraps major releases, there may be a React-Bootstrap v3 targeting Bootstrap 6 depending on what's best for the project.
Below is a rough account of the breaking API changes as well as the minimal change to migrate
AccordionContext's value interface has changed.AccordionToggle has been renamed to AccordionButton.useAccordionToggle has been renamed to useAccordionButton.variant has been renamed to bg.toggle.CardColumns.label prop in favor of aria-label.variant prop.ColOrder is now maximum 5 instead of 12.span is no longer true by default.hr by default instead of div.left and right changed to start and end respectively.alignRight. Use align="end" instead.menuAlign prop in favor of align.onSelect. Use onSelect in the parent Dropdown instead.alignRight. Use align="end" instead.inline.bsPrefix.bsCustomPrefix and custom in favor of bsSwitchPrefix.feedbackType instead of isValid and isInvalid.bsCustomPrefix.isStatic.bsCustomPrefix.form-check-input to form-check-label.as prop supporting select tags in favor of FormSelect.custom.bsCustomPrefix.type supporting the range value in favor of FormRange.<Form.Control type="file" /> instead.bsPrefix. The .form-group class is no longer supported in Bootstrap,
but this component is useful for passing controlId to labels and inputs. To handle
spacing, use margin utilities instead.Row instead.InputGroupPrepend and InputGroupAppend. Buttons and InputGroupText can now be added as direct children.Tabs instead.onSelect. Use onSelect in the parent Nav instead.content prop to body to coincide with PopoverContent component name change.menuAlign prop in favor of align.delay is now default 5000 ms.bsPrefix.id is now required. This is to allow toggling of the input due to markup changes in Bootstrap.