Skip to content

support react 19#3646

Closed
T4rk1n wants to merge 9 commits into
devfrom
react19
Closed

support react 19#3646
T4rk1n wants to merge 9 commits into
devfrom
react19

Conversation

@T4rk1n

@T4rk1n T4rk1n commented Mar 11, 2026

Copy link
Copy Markdown
Contributor
  • Remove react 16 support.
  • Add react 19 experimental support, use with:
from dash._dash_renderer import _set_react_version

_set_react_version("19.2.0")

@github-actions

github-actions Bot commented Mar 11, 2026

Copy link
Copy Markdown

Thank you for your contribution to Dash! 🎉

This PR is exempt from requiring a linked issue due to its labels.

@AnnMarieW

Copy link
Copy Markdown
Collaborator

Thanks for supporting React 19 🎉

I see all the tests pass, but when I run apps setting react to 19.2.0 some components work (like dcc.Markdown and dcc.Input) but others do not, such as dcc.RangeSlider and the date picker components. The error is:

Cannot read properties of undefined (reading 'ReactCurrentOwner')

I see the same error if I set react 19 in the tests for those components.

@ndrezn ndrezn linked an issue Mar 23, 2026 that may be closed by this pull request
@camdecoster
camdecoster marked this pull request as draft April 15, 2026 15:26
@AnnMarieW

Copy link
Copy Markdown
Collaborator

I tried this again, and here's some more feedback:

The new React 19 shim seems to fix the ReactCurrentOwner error with DCC components.

I also tried a simple quick start app in a few other libraries:

  • dash-ag-grid 35.2 worked fine.
  • dash-daq 0.6.0 worked fine.
  • dash-bootstrap-components 2.0.4 had the errors shown below. DBC v2 is based on react-bootstrap v2 which does not support React.19, so that wasn't surprising.
  • dash-mantine-components 2.6.1 had the same errors as DBC. However, DMC v2 is based on Mantine v8 which is compatible with React 19, so that was a little unexpected.

Errors in both DMC and DBC if a component is defined in the app:

Uncaught TypeError: Cannot read properties of undefined (reading 'ReactCurrentOwner')
at Array. (dash_bootstrap_components.v2_0_4m1759328733.min.js:2:12535)
at n (dash_bootstrap_components.v2_0_4m1759328733.min.js:2:13035)
at Array. (dash_bootstrap_components.v2_0_4m1759328733.min.js:2:12343)
at n (dash_bootstrap_components.v2_0_4m1759328733.min.js:2:13035)
at dash_bootstrap_components.v2_0_4m1759328733.min.js:2:17559
at dash_bootstrap_components.v2_0_4m1759328733.min.js:2:227635
at dash_bootstrap_components.v2_0_4m1759328733.min.js:2:227674

Also, if the component is added to the layout, the app doesn't render, and there is also the following errors:

Uncaught Error: dash_bootstrap_components was not found.
at Object.resolve (registry.js:15:15)
at getProps (persistence.js:293:30)
at persistenceMods (persistence.js:404:9)
at persistence.js:437:29
at Array.forEach ()
at persistenceMods (persistence.js:435:18)
at applyPersistence (persistence.js:370:12)
at APIController.react.js:161:53
at exports.unstable_batchedUpdates (react-dom.development.js:411:14)
at storeEffect (APIController.react.js:150:10)Understand this error

installHook.js:1 An error occurred in the component.
Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://react.dev/link/error-boundaries to learn more about error boundaries.
overrideMethod @ installHook.js:1Understand this warning

@T4rk1n T4rk1n mentioned this pull request Jul 6, 2026
@T4rk1n

T4rk1n commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #3880

@T4rk1n T4rk1n closed this Jul 6, 2026
pull Bot pushed a commit to adfernandes/dash that referenced this pull request Jul 23, 2026
Port PR plotly#3646 (react19 branch) onto current dev, with fixes for the
third-party component library issues reported there:

- Add React 19.2.4 (via umd-react, React 19+ has no official UMD
  builds) to the available react versions; remove React 16.
- New react-shim.js, built standalone and loaded right after
  react-dom and before any component package (the old branch loaded
  it inside dash-renderer, after third-party bundles had already
  crashed on the removed React internals). It stubs ReactCurrentOwner,
  redirects the legacy 'react.element' $$typeof symbol so libraries
  that pre-bundled a React <=18 jsx-runtime don't hit React error
  #525, and provides window.ReactJSXRuntime.
- Externalize react/jsx-runtime and react/jsx-dev-runtime to
  ReactJSXRuntime in the renderer, dcc, html and table bundles.
- Use umd-react@19.2.4 rather than 19.2.0, which silently bundles
  React 19.1.0.
- CI: run main, html and dcc test jobs against React 18.3.1 and
  19.2.4; keep Percy pinned to 18.3.1.

Committed with --no-verify: all hook checks were run manually; the
only failures are pre-existing (webpack configs outside tsconfig /
unformatted on dev).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

implement support for React 19

3 participants