Skip to content

feat(react): upgrade to React 19 and replace reactstrap with react-bo…#32495

Merged
mshima merged 6 commits into
jhipster:mainfrom
sreeshanth-soma:feat/react-19-react-bootstrap
Mar 5, 2026
Merged

feat(react): upgrade to React 19 and replace reactstrap with react-bo…#32495
mshima merged 6 commits into
jhipster:mainfrom
sreeshanth-soma:feat/react-19-react-bootstrap

Conversation

@sreeshanth-soma

@sreeshanth-soma sreeshanth-soma commented Mar 1, 2026

Copy link
Copy Markdown
Contributor

Motivation

React 19 removes findDOMNode, which reactstrap depends on internally through react-transition-group. This causes runtime crashes in generated applications whenever modals, dropdowns, collapses, or tooltips are rendered.

Rather than polyfilling findDOMNode back 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/reactstrap fork 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

Package Previous Updated
react / react-dom 18.3.1 19.1.0
@types/react 18.3.12 19.1.6
@types/react-dom 18.3.1 19.1.6
reactstrap 9.2.3 removed
react-bootstrap 2.10.9

npm overrides were added for react-jhipster and react-redux-loading-bar to resolve their React 18 peer dependency declarations until they publish compatible releases.

React 19 breaking changes

  • Replaced JSX.Element with React.JSX.Element in typings.d.ts.ejs, error-boundary-routes.spec.tsx.ejs, and private-route.spec.tsx.ejs (global JSX namespace removed in v19).
  • Added non-null assertion to document.getElementById('root')! in index.tsx.ejs (stricter createRoot null handling).

Template migration

All 33 template files were migrated from reactstrap to react-bootstrap. The API differences handled include:

  • Prop renames: color to variant on Button and Alert, color to bg on Badge, tag to as for polymorphic rendering, isOpen to show/in, toggle to onHide.
  • Component replacements: NavbarToggler to NavbarToggle, UncontrolledDropdown to Dropdown, UncontrolledTooltip to OverlayTrigger + Tooltip, Input to FormControl.
  • Modal changes: ModalHeader toggle={fn} to ModalHeader closeButton (close handler inherited from parent Modal's onHide), removed modalTransition/backdropTransition props.

Testing

  • npm run ejslint passes with zero errors.
  • Zero reactstrap references remain across all .ts, .json, and .ejs files in generators/react/.

Closes #28130

@github-actions github-actions Bot added theme: react theme: dependencies Pull requests that update a dependency file labels Mar 1, 2026
@sreeshanth-soma sreeshanth-soma force-pushed the feat/react-19-react-bootstrap branch 2 times, most recently from 4c694a0 to 9218c36 Compare March 2, 2026 00:48
@sreeshanth-soma

Copy link
Copy Markdown
Contributor Author

@mshima could you please approve the workflows so the checks can run

@mshima

mshima commented Mar 2, 2026

Copy link
Copy Markdown
Member

react-jhipster has a dependency on reactstrap, needs to be dropped or updated.

@sreeshanth-soma

Copy link
Copy Markdown
Contributor Author

@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?

@mshima

mshima commented Mar 3, 2026

Copy link
Copy Markdown
Member

@sreeshanth-soma sure go ahead.

@sreeshanth-soma

Copy link
Copy Markdown
Contributor Author

Hello @mshima, I have opened a PR on react-jhipster to replace reactstrap with react-bootstrap: jhipster/react-jhipster#104
Once published, I will bump the version here so CI can pass.

@sreeshanth-soma sreeshanth-soma force-pushed the feat/react-19-react-bootstrap branch 6 times, most recently from f885c39 to 1c9efb5 Compare March 3, 2026 16:33
Comment thread generators/react/generator.ts Outdated
Comment thread generators/workspaces/generator.ts Outdated
@sreeshanth-soma sreeshanth-soma force-pushed the feat/react-19-react-bootstrap branch from 1c9efb5 to 8749baf Compare March 3, 2026 17:33
@sreeshanth-soma

Copy link
Copy Markdown
Contributor Author

Hello @mshima
All checks are passing now. Ready for review whenever you get a chance. Thanks for the help with the typings and overrides fixes!

@mshima mshima closed this Mar 4, 2026
@mshima mshima reopened this Mar 4, 2026
@mshima mshima mentioned this pull request Mar 4, 2026
1 task
@mshima

mshima commented Mar 4, 2026

Copy link
Copy Markdown
Member

The menu needs adjusts:

reactstrap:
Captura de Tela 2026-03-04 às 18 08 22

react-bootstrap:
Captura de Tela 2026-03-04 às 18 08 30

@mshima mshima requested a review from qmonmert March 5, 2026 00:42
@mshima

mshima commented Mar 5, 2026

Copy link
Copy Markdown
Member

@qmonmert can you take a look?
I've used the following command to test.

npx github:sreeshanth-soma/generator-jhipster#feat/react-19-react-bootstrap --defaults --client-framework react --dev-database-type h2Disk

@mraible

mraible commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

I can hold the beta.4 release for this PR if you like.

@mshima

mshima commented Mar 5, 2026

Copy link
Copy Markdown
Member

IMO this is the way forward.
Merging.

@mshima mshima merged commit 8857348 into jhipster:main Mar 5, 2026
63 checks passed
@mshima

mshima commented Mar 5, 2026

Copy link
Copy Markdown
Member

@sreeshanth-soma thanks and great work.

@mshima mshima mentioned this pull request Mar 5, 2026
3 tasks
@sreeshanth-soma

Copy link
Copy Markdown
Contributor Author

Thank you @mshima! Really enjoyed working through this one, learned a lot in the process and appreciate all the guidance along the way.

@qmonmert

qmonmert commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

Yes great work @sreeshanth-soma 👍

@sreeshanth-soma

Copy link
Copy Markdown
Contributor Author

Yes great work @sreeshanth-soma 👍

Thank you @qmonmert!

@sreeshanth-soma

Copy link
Copy Markdown
Contributor Author

Opencollective

@mshima claiming the bounty for this pr.
Thank you

@jdubois

jdubois commented Mar 7, 2026

Copy link
Copy Markdown
Member

Approved. Than you @sreeshanth-soma !

@sreeshanth-soma

Copy link
Copy Markdown
Contributor Author

Approved. Than you @sreeshanth-soma !

@jdubois thank you!

@mshima

mshima commented Mar 7, 2026

Copy link
Copy Markdown
Member

@sreeshanth-soma CI is failling on windows: https://github.com/hipster-labs/jhipster-daily-builds/actions/workflows/windows.yaml
At first sight doesn't look related but the timeline matches. Any idea?

@sreeshanth-soma

sreeshanth-soma commented Mar 8, 2026

Copy link
Copy Markdown
Contributor Author

@mshima yeah it's related, "react-jhipster": "github:jhipster/react-jhipster#main" breaks on windows because npm runs the prepare script on git deps, and the cleanup script does rimraf lib/*. The * is illegal in windows paths so rimraf throws EINVAL .

Quickest fix would be changing lib/* to just lib in react-jhipster's cleanup script, or publishing a new version to npm so we dont need the git URL at all.

Let me know if you would like me to open a PR on react-jhipster for the cleanup script fix, happy to do it.

@mshima

mshima commented Mar 8, 2026

Copy link
Copy Markdown
Member

@sreeshanth-soma would be great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

theme: dependencies Pull requests that update a dependency file theme: front theme: react

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update to React 19

5 participants