Skip to content

feat(components): bump react from 18.3.1 to 19.0.0 in /components#673

Open
dependabot[bot] wants to merge 8 commits intomainfrom
dependabot/npm_and_yarn/components/react-19.0.0
Open

feat(components): bump react from 18.3.1 to 19.0.0 in /components#673
dependabot[bot] wants to merge 8 commits intomainfrom
dependabot/npm_and_yarn/components/react-19.0.0

Conversation

@dependabot
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jan 20, 2025

Bumps react from 18.3.1 to 19.0.0.

Release notes

Sourced from react's releases.

19.0.0 (December 5, 2024)

Below is a list of all new features, APIs, deprecations, and breaking changes. Read React 19 release post and React 19 upgrade guide for more information.

Note: To help make the upgrade to React 19 easier, we’ve published a react@18.3 release that is identical to 18.2 but adds warnings for deprecated APIs and other changes that are needed for React 19. We recommend upgrading to React 18.3.1 first to help identify any issues before upgrading to React 19.

New Features

React

  • Actions: startTransition can now accept async functions. Functions passed to startTransition are called “Actions”. A given Transition can include one or more Actions which update state in the background and update the UI with one commit. In addition to updating state, Actions can now perform side effects including async requests, and the Action will wait for the work to finish before finishing the Transition. This feature allows Transitions to include side effects like fetch() in the pending state, and provides support for error handling, and optimistic updates.
  • useActionState: is a new hook to order Actions inside of a Transition with access to the state of the action, and the pending state. It accepts a reducer that can call Actions, and the initial state used for first render. It also accepts an optional string that is used if the action is passed to a form action prop to support progressive enhancement in forms.
  • useOptimistic: is a new hook to update state while a Transition is in progress. It returns the state, and a set function that can be called inside a transition to “optimistically” update the state to expected final value immediately while the Transition completes in the background. When the transition finishes, the state is updated to the new value.
  • use: is a new API that allows reading resources in render. In React 19, use accepts a promise or Context. If provided a promise, use will suspend until a value is resolved. use can only be used in render but can be called conditionally.
  • ref as a prop: Refs can now be used as props, removing the need for forwardRef.
  • Suspense sibling pre-warming: When a component suspends, React will immediately commit the fallback of the nearest Suspense boundary, without waiting for the entire sibling tree to render. After the fallback commits, React will schedule another render for the suspended siblings to “pre-warm” lazy requests.

React DOM Client

  • <form> action prop: Form Actions allow you to manage forms automatically and integrate with useFormStatus. When a <form> action succeeds, React will automatically reset the form for uncontrolled components. The form can be reset manually with the new requestFormReset API.
  • <button> and <input> formAction prop: Actions can be passed to the formAction prop to configure form submission behavior. This allows using different Actions depending on the input.
  • useFormStatus: is a new hook that provides the status of the parent <form> action, as if the form was a Context provider. The hook returns the values: pending, data, method, and action.
  • Support for Document Metadata: We’ve added support for rendering document metadata tags in components natively. React will automatically hoist them into the <head> section of the document.
  • Support for Stylesheets: React 19 will ensure stylesheets are inserted into the <head> on the client before revealing the content of a Suspense boundary that depends on that stylesheet.
  • Support for async scripts: Async scripts can be rendered anywhere in the component tree and React will handle ordering and deduplication.
  • Support for preloading resources: React 19 ships with preinit, preload, prefetchDNS, and preconnect APIs to optimize initial page loads by moving discovery of additional resources like fonts out of stylesheet loading. They can also be used to prefetch resources used by an anticipated navigation.

React DOM Server

  • Added prerender and prerenderToNodeStream APIs for static site generation. They are designed to work with streaming environments like Node.js Streams and Web Streams. Unlike renderToString, they wait for data to load for HTML generation.

React Server Components

  • RSC features such as directives, server components, and server functions are now stable. This means libraries that ship with Server Components can now target React 19 as a peer dependency with a react-server export condition for use in frameworks that support the Full-stack React Architecture. The underlying APIs used to implement a React Server Components bundler or framework do not follow semver and may break between minors in React 19.x. See docs for how to support React Server Components.

Deprecations

  • Deprecated: element.ref access: React 19 supports ref as a prop, so we’re deprecating element.ref in favor of element.props.ref. Accessing will result in a warning.
  • react-test-renderer: In React 19, react-test-renderer logs a deprecation warning and has switched to concurrent rendering for web usage. We recommend migrating your tests to @​testinglibrary.com/docs/react-testing-library/intro/) or @​testingesting-library.com/docs/react-native-testing-library/intro)

Breaking Changes

React 19 brings in a number of breaking changes, including the removals of long-deprecated APIs. We recommend first upgrading to 18.3.1, where we've added additional deprecation warnings. Check out the upgrade guide for more details and guidance on codemodding.

React

  • New JSX Transform is now required: We introduced a new JSX transform in 2020 to improve bundle size and use JSX without importing React. In React 19, we’re adding additional improvements like using ref as a prop and JSX speed improvements that require the new transform.
  • Errors in render are not re-thrown: Errors that are not caught by an Error Boundary are now reported to window.reportError. Errors that are caught by an Error Boundary are reported to console.error. We’ve introduced onUncaughtError and onCaughtError methods to createRoot and hydrateRoot to customize this error handling.
  • Removed: propTypes: Using propTypes will now be silently ignored. If required, we recommend migrating to TypeScript or another type-checking solution.
  • Removed: defaultProps for functions: ES6 default parameters can be used in place. Class components continue to support defaultProps since there is no ES6 alternative.
  • Removed: contextTypes and getChildContext: Legacy Context for class components has been removed in favor of the contextType API.

... (truncated)

Changelog

Sourced from react's changelog.

19.0.0 (December 5, 2024)

Below is a list of all new features, APIs, deprecations, and breaking changes. Read React 19 release post and React 19 upgrade guide for more information.

Note: To help make the upgrade to React 19 easier, we’ve published a react@18.3 release that is identical to 18.2 but adds warnings for deprecated APIs and other changes that are needed for React 19. We recommend upgrading to React 18.3.1 first to help identify any issues before upgrading to React 19.

New Features

React

  • Actions: startTransition can now accept async functions. Functions passed to startTransition are called “Actions”. A given Transition can include one or more Actions which update state in the background and update the UI with one commit. In addition to updating state, Actions can now perform side effects including async requests, and the Action will wait for the work to finish before finishing the Transition. This feature allows Transitions to include side effects like fetch() in the pending state, and provides support for error handling, and optimistic updates.
  • useActionState: is a new hook to order Actions inside of a Transition with access to the state of the action, and the pending state. It accepts a reducer that can call Actions, and the initial state used for first render. It also accepts an optional string that is used if the action is passed to a form action prop to support progressive enhancement in forms.
  • useOptimistic: is a new hook to update state while a Transition is in progress. It returns the state, and a set function that can be called inside a transition to “optimistically” update the state to expected final value immediately while the Transition completes in the background. When the transition finishes, the state is updated to the new value.
  • use: is a new API that allows reading resources in render. In React 19, use accepts a promise or Context. If provided a promise, use will suspend until a value is resolved. use can only be used in render but can be called conditionally.
  • ref as a prop: Refs can now be used as props, removing the need for forwardRef.
  • Suspense sibling pre-warming: When a component suspends, React will immediately commit the fallback of the nearest Suspense boundary, without waiting for the entire sibling tree to render. After the fallback commits, React will schedule another render for the suspended siblings to “pre-warm” lazy requests.

React DOM Client

  • <form> action prop: Form Actions allow you to manage forms automatically and integrate with useFormStatus. When a <form> action succeeds, React will automatically reset the form for uncontrolled components. The form can be reset manually with the new requestFormReset API.
  • <button> and <input> formAction prop: Actions can be passed to the formAction prop to configure form submission behavior. This allows using different Actions depending on the input.
  • useFormStatus: is a new hook that provides the status of the parent <form> action, as if the form was a Context provider. The hook returns the values: pending, data, method, and action.
  • Support for Document Metadata: We’ve added support for rendering document metadata tags in components natively. React will automatically hoist them into the <head> section of the document.
  • Support for Stylesheets: React 19 will ensure stylesheets are inserted into the <head> on the client before revealing the content of a Suspense boundary that depends on that stylesheet.
  • Support for async scripts: Async scripts can be rendered anywhere in the component tree and React will handle ordering and deduplication.
  • Support for preloading resources: React 19 ships with preinit, preload, prefetchDNS, and preconnect APIs to optimize initial page loads by moving discovery of additional resources like fonts out of stylesheet loading. They can also be used to prefetch resources used by an anticipated navigation.

React DOM Server

  • Added prerender and prerenderToNodeStream APIs for static site generation. They are designed to work with streaming environments like Node.js Streams and Web Streams. Unlike renderToString, they wait for data to load for HTML generation.

React Server Components

  • RSC features such as directives, server components, and server functions are now stable. This means libraries that ship with Server Components can now target React 19 as a peer dependency with a react-server export condition for use in frameworks that support the Full-stack React Architecture. The underlying APIs used to implement a React Server Components bundler or framework do not follow semver and may break between minors in React 19.x. See docs for how to support React Server Components.

Deprecations

  • Deprecated: element.ref access: React 19 supports ref as a prop, so we’re deprecating element.ref in favor of element.props.ref. Accessing will result in a warning.
  • react-test-renderer: In React 19, react-test-renderer logs a deprecation warning and has switched to concurrent rendering for web usage. We recommend migrating your tests to @​testing-library/react or @​testing-library/react-native

Breaking Changes

React 19 brings in a number of breaking changes, including the removals of long-deprecated APIs. We recommend first upgrading to 18.3.1, where we've added additional deprecation warnings. Check out the upgrade guide for more details and guidance on codemodding.

React

  • New JSX Transform is now required: We introduced a new JSX transform in 2020 to improve bundle size and use JSX without importing React. In React 19, we’re adding additional improvements like using ref as a prop and JSX speed improvements that require the new transform.
  • Errors in render are not re-thrown: Errors that are not caught by an Error Boundary are now reported to window.reportError. Errors that are caught by an Error Boundary are reported to console.error. We’ve introduced onUncaughtError and onCaughtError methods to createRoot and hydrateRoot to customize this error handling.
  • Removed: propTypes: Using propTypes will now be silently ignored. If required, we recommend migrating to TypeScript or another type-checking solution.
  • Removed: defaultProps for functions: ES6 default parameters can be used in place. Class components continue to support defaultProps since there is no ES6 alternative.

... (truncated)

Commits
  • e137890 [string-refs] cleanup string ref code (#31443)
  • d1f0472 [string-refs] remove enableLogStringRefsProd flag (#31414)
  • 3dc1e48 Followup: remove dead test code from #30346 (#31415)
  • 07aa494 Remove enableRefAsProp feature flag (#30346)
  • 45804af [flow] Eliminate usage of more than 1-arg React.AbstractComponent in React ...
  • 5636fad [string-refs] log string ref from prod (#31161)
  • b78a7f2 [rcr] Re-export useMemoCache in top level React namespace (#31139)
  • 4e9540e [Fiber] Log the Render/Commit phases and the gaps in between (#31016)
  • d4688df [Fiber] Track Event Time, startTransition Time and setState Time (#31008)
  • 15da917 Don't read currentTransition back from internals (#30991)
  • Additional commits viewable in compare view

Dependabot compatibility score

You can trigger a rebase of this PR by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Note
Automatic rebases have been disabled on this pull request as it has been open for over 30 days.

@dependabot dependabot bot added dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code labels Jan 20, 2025
@vercel
Copy link

vercel bot commented Jan 20, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dashboard-components Ready Ready Preview, Comment Mar 9, 2026 8:29am

Request Review

@github-actions
Copy link
Contributor

github-actions bot commented Jan 20, 2025

This is a preview of the changelog of the next release. If this branch is not up-to-date with the current main branch, the changelog may not be accurate. Rebase your branch on the main branch to get the most accurate changelog.

Note that this might contain changes that are on main, but not yet released.

Changelog:

0.13.3 (2025-01-23)

Features

  • components: use the React 19 syntax to declare components for React (1eb4204)

Copy link
Contributor

@JonasKellerer JonasKellerer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. It works well for me in the dashborad-components repo (example and storybook).

I have also tried to use it in dashborads. There I still get the error (after upgrading also to react 19:
TS2339: Property gs-date-range-selector does not exist on type JSX. IntrinsicElements
This might be caused by astro, since it does not (fully) support react 19. withastro/astro#12686
However, one can use the components there (with the new syntax), so I think this is fine.

@fengelniederhammer
Copy link
Collaborator

However, one can use the components there (with the new syntax), so I think this is fine.

I just checked, with this version of the components, the typecheck will fail in the dashboards. I'm not sure how much of an Astro problem that is. Let's still delay this and check back later?

@JonasKellerer
Copy link
Contributor

Seems fine for me. I think this PR will not take much time to update later.

@dependabot @github
Copy link
Contributor Author

dependabot bot commented on behalf of github Apr 7, 2025

A newer version of react exists, but since this PR has been edited by someone other than Dependabot I haven't updated it. You'll get a PR for the updated version as normal once this PR is merged.

dependabot bot and others added 2 commits March 5, 2026 10:03
Bumps [react](https://github.com/facebook/react/tree/HEAD/packages/react) from 18.3.1 to 19.0.0.
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/v19.0.0/packages/react)

---
updated-dependencies:
- dependency-name: react
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@fengelniederhammer fengelniederhammer force-pushed the dependabot/npm_and_yarn/components/react-19.0.0 branch from 1eb4204 to 0ad3a22 Compare March 5, 2026 09:11
@fengelniederhammer
Copy link
Collaborator

fengelniederhammer commented Mar 9, 2026

It can be tested with GenSpectrum/dashboards#1064 in the dashboards.

I think it also works with React 18 users AFAICS. But we still need to release a new version for this -> made it a feat.

@fengelniederhammer fengelniederhammer changed the title chore(components): bump react from 18.3.1 to 19.0.0 in /components feat(components): bump react from 18.3.1 to 19.0.0 in /components Mar 9, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR upgrades the React dependency in the components package to React 19 and updates the TypeScript/JSX typing strategy for the exported web components so they can be used from React 19 projects. It also updates the React example app to pass structured values (arrays/objects) into the gs-* custom elements.

Changes:

  • Bump react (and React types in the example) to 19.0.0 and update example tooling (@vitejs/plugin-react).
  • Update custom-element JSX typings from namespace JSX to namespace React.JSX across the web component wrappers.
  • Improve Zod validation messages by adding errorMap to a couple of array schemas; update the React example to pass objects/arrays rather than JSON strings.

Reviewed changes

Copilot reviewed 24 out of 25 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
examples/React/src/App.tsx Updates example usage for React 19 + passes object/array props into custom elements.
examples/React/package.json Bumps React, React DOM, React type packages, and Vite React plugin for the example app.
components/src/web-components/wastewaterVisualization/gs-wastewater-mutations-over-time.tsx Switches JSX namespace to React.JSX and adjusts intrinsic element typing.
components/src/web-components/visualization/gs-statistics.tsx Switches JSX namespace to React.JSX and adjusts intrinsic element typing.
components/src/web-components/visualization/gs-sequences-by-location.tsx Switches JSX namespace to React.JSX and adjusts intrinsic element typing.
components/src/web-components/visualization/gs-relative-growth-advantage.tsx Switches JSX namespace to React.JSX and adjusts intrinsic element typing.
components/src/web-components/visualization/gs-queries-over-time.tsx Switches JSX namespace to React.JSX and adjusts intrinsic element typing.
components/src/web-components/visualization/gs-prevalence-over-time.tsx Switches JSX namespace to React.JSX and adjusts intrinsic element typing.
components/src/web-components/visualization/gs-number-sequences-over-time.tsx Switches JSX namespace to React.JSX and adjusts intrinsic element typing.
components/src/web-components/visualization/gs-mutations.tsx Switches JSX namespace to React.JSX and adjusts intrinsic element typing; minor formatting.
components/src/web-components/visualization/gs-mutations-over-time.tsx Switches JSX namespace to React.JSX and adjusts intrinsic element typing.
components/src/web-components/visualization/gs-mutation-comparison.tsx Switches JSX namespace to React.JSX and adjusts intrinsic element typing.
components/src/web-components/visualization/gs-genome-data-viewer.tsx Switches JSX namespace to React.JSX and adjusts intrinsic element typing.
components/src/web-components/visualization/gs-aggregate.tsx Switches JSX namespace to React.JSX and adjusts intrinsic element typing.
components/src/web-components/mutation-annotations-context.ts Adds custom Zod error mapping for invalid mutation annotations arrays.
components/src/web-components/input/gs-text-filter.tsx Switches JSX namespace to React.JSX and adjusts intrinsic element typing.
components/src/web-components/input/gs-number-range-filter.tsx Switches JSX namespace to React.JSX and adjusts intrinsic element typing.
components/src/web-components/input/gs-mutation-filter.tsx Switches JSX namespace to React.JSX and adjusts intrinsic element typing; minor formatting.
components/src/web-components/input/gs-location-filter.tsx Switches JSX namespace to React.JSX and adjusts intrinsic element typing.
components/src/web-components/input/gs-lineage-filter.tsx Switches JSX namespace to React.JSX and adjusts intrinsic element typing.
components/src/web-components/input/gs-date-range-filter.tsx Switches JSX namespace to React.JSX and adjusts intrinsic element typing.
components/src/web-components/gs-app.ts Switches JSX namespace to React.JSX and adjusts intrinsic element typing.
components/src/preact/mutationsOverTime/getFilteredMutationsOverTimeData.ts Adds custom Zod error mapping for invalid “display mutations” arrays.
components/package.json Bumps react devDependency in the components workspace to 19.
components/package-lock.json Locks updated React 19 dependency graph (including scheduler/react-dom peer resolution).
Files not reviewed (1)
  • components/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +131 to 135
namespace React.JSX {
interface IntrinsicElements {
'gs-app': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
'gs-app': AppComponent;
}
}
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

React.JSX.IntrinsicElements['gs-app'] is set to AppComponent, but that type doesn’t include standard JSX/DOM props (e.g. ref, children, className, style, event handlers). This will cause TypeScript errors for React consumers (and the React example) when using <gs-app> with children or refs. Define the intrinsic element type as React’s DOM props for the element (so ref/children are included) and intersect/augment it with the component’s custom properties instead of using the element class directly as the props type.

Copilot uses AI. Check for mistakes.
Comment on lines +112 to 116
namespace React.JSX {
interface IntrinsicElements {
'gs-location-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
'gs-location-filter': LocationFilterComponent;
}
}
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

React.JSX.IntrinsicElements['gs-location-filter'] is typed as LocationFilterComponent, which omits standard JSX/DOM attributes like ref. React users commonly need ref for custom elements (and the React example uses it), so this typing will block compilation. Use a DOM-props-based type for the intrinsic element (including ref) and extend it with the component’s custom properties.

Copilot uses AI. Check for mistakes.
Comment on lines +146 to 149
namespace React.JSX {
interface IntrinsicElements {
'gs-date-range-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
'gs-date-range-filter': DateRangeFilterComponent;
}
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue as other web component JSX typings: React.JSX.IntrinsicElements['gs-date-range-filter'] is set to DateRangeFilterComponent, which won’t include standard JSX/DOM props like ref, className, etc. This will break TypeScript in React apps (the React example passes a ref). Define the intrinsic element props based on React’s HTML/DOM attribute types for the element and then add the custom properties.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Check upgrade to React 19

3 participants