dashboard icon indicating copy to clipboard operation
dashboard copied to clipboard

Update React

Open AlanGreene opened this issue 1 year ago • 1 comments

Update to the next major React release (currently v18, v19 may be released soon)

A number of other dependencies will also need to be updated at the same time:

  • [ ] @tanstack/react-query@5
    • v5 drops support for React 17
    • most of the preparation already done as part of React Router v6 update in https://github.com/tektoncd/dashboard/pull/3465 and related issues. Remaining config changes described below
    • originally described in https://github.com/tektoncd/dashboard/issues/2452#issuecomment-2186647884
    • https://tanstack.com/query/latest/docs/framework/react/guides/migrating-to-v5
      • rename cacheTime to gcTime
      • rename isLoading to isPending
        • also renames status: loading to status: pending, and isInitialLoading to isLoading
        • can we stick with isLoading for most of our use cases? (the new isLoading is isPending && isFetching)
        • see the 'status: pending' section of https://github.com/TanStack/query/discussions/4252 for details
    • minimum react version 18.2.0
  • [ ] @testing-library/react@13 or later
    • v13 drops support for React 17
  • [ ] react-is (used by Carbon)
  • [ ] ?

AlanGreene avatar Jul 03 '24 11:07 AlanGreene

Recent post from Carbon maintainers, see https://github.com/carbon-design-system/carbon/issues/18714#issuecomment-2691357012:

Overall support for react 16 is waning. Usage is very low both in the industry and with @carbon/react users. The next major version of @carbon/react will drop support for v16 and v17.

Carbon v12 is tentatively scheduled for initial prerelease in August 2025, and active release status by end of March 2026. We should aim for the components to at least be compatible with React 18 by August, with a view to fully upgrading the project by end of year to make sure we're ready.

AlanGreene avatar Feb 28 '25 20:02 AlanGreene

Looks like @testing-library/react-hooks doesnt support React 18 or newer, migration required.

Migration guide here to move to using hooks support directly from @testing-library/react instead: https://github.com/testing-library/react-hooks-testing-library/blob/chore/migration-guide/MIGRATION_GUIDE.md

briangleeson avatar Oct 07 '25 12:10 briangleeson

This is done now, closing. We'll track the React 19 update in a new issue.

AlanGreene avatar Nov 05 '25 10:11 AlanGreene