feat(react): upgrade to React 19 and replace reactstrap with react-bo…#32495
Conversation
4c694a0 to
9218c36
Compare
|
@mshima could you please approve the workflows so the checks can run |
|
|
|
@mshima thank you for the suggestion. I checked the react-jhipster source and saw that JhiPagination, the Metrics components, and ValidatedForm still import from reactstrap. Before we can merge this generator PR, those components in react-jhipster will need to be migrated to react-bootstrap (or drop the dependency). Since getting this PR merged is blocking my work on the React 19 upgrade, I would be happy to open a PR on the react-jhipster repo to migrate those remaining components to react-bootstrap. Would you be open to a PR for that? |
|
@sreeshanth-soma sure go ahead. |
|
Hello @mshima, I have opened a PR on react-jhipster to replace reactstrap with react-bootstrap: jhipster/react-jhipster#104 |
f885c39 to
1c9efb5
Compare
1c9efb5 to
8749baf
Compare
|
Hello @mshima |
|
@qmonmert can you take a look? npx github:sreeshanth-soma/generator-jhipster#feat/react-19-react-bootstrap --defaults --client-framework react --dev-database-type h2Disk |
|
I can hold the beta.4 release for this PR if you like. |
|
IMO this is the way forward. |
|
@sreeshanth-soma thanks and great work. |
|
Thank you @mshima! Really enjoyed working through this one, learned a lot in the process and appreciate all the guidance along the way. |
|
Yes great work @sreeshanth-soma 👍 |
Thank you @qmonmert! |
|
@mshima claiming the bounty for this pr. |
|
Approved. Than you @sreeshanth-soma ! |
@jdubois thank you! |
|
@sreeshanth-soma CI is failling on windows: https://github.com/hipster-labs/jhipster-daily-builds/actions/workflows/windows.yaml |
|
@mshima yeah it's related, Quickest fix would be changing Let me know if you would like me to open a PR on react-jhipster for the cleanup script fix, happy to do it. |
|
@sreeshanth-soma would be great |


Motivation
React 19 removes
findDOMNode, which reactstrap depends on internally throughreact-transition-group. This causes runtime crashes in generated applications whenever modals, dropdowns, collapses, or tooltips are rendered.Rather than polyfilling
findDOMNodeback onto ReactDOM (the approach in #32473), this PR follows the maintainer consensus from @mshima, @mraible, and @DanielFran to replace reactstrap with react-bootstrap. react-bootstrap has native React 19 support, no dependency on deprecated APIs, and uses the same Bootstrap 5 CSS, so generated applications remain visually identical.@DanielFran also noted the
@neolution-ch/reactstrapfork as an alternative. react-bootstrap was chosen over it because it is a first-party project with a larger community and does not depend on deprecated React internals, making it the more sustainable long-term choice.Changes
Dependencies
npm overrides were added for
react-jhipsterandreact-redux-loading-barto resolve their React 18 peer dependency declarations until they publish compatible releases.React 19 breaking changes
JSX.ElementwithReact.JSX.Elementin typings.d.ts.ejs, error-boundary-routes.spec.tsx.ejs, and private-route.spec.tsx.ejs (global JSX namespace removed in v19).document.getElementById('root')!in index.tsx.ejs (strictercreateRootnull handling).Template migration
All 33 template files were migrated from reactstrap to react-bootstrap. The API differences handled include:
colortovarianton Button and Alert,colortobgon Badge,tagto as for polymorphic rendering,isOpentoshow/in,toggletoonHide.NavbarTogglertoNavbarToggle,UncontrolledDropdowntoDropdown,UncontrolledTooltiptoOverlayTrigger+Tooltip,InputtoFormControl.ModalHeader toggle={fn}toModalHeader closeButton(close handler inherited from parent Modal'sonHide), removedmodalTransition/backdropTransitionprops.Testing
npm run ejslintpasses with zero errors.reactstrapreferences remain across all .ts,.json, and .ejs files ingenerators/react/.Closes #28130