Repository navigation
Conversation
- Remove `^17.0.0` from the `react` and `react-dom` peer ranges. - Use `React.useSyncExternalStore` and remove the `use-sync-external-store` dependency. - Replace the React 17 ESLint guard with a smaller React 18 guard. - Remove the React 17 skips and dynamic imports from the SSR tests. - Update the peer ranges in the quickstart docs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Replace the no-argument `@mui/utils/useId` and `@base-ui/utils/useId` calls with `React.useId()`. - Remove the `| undefined` types, `!` assertions and guards that only exist for the React 17 first render. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deploy previewBundle size
PerformanceTotal duration: 1,674.05 ms +210.82 ms(+14.4%) | Renders: 63 (+0) | Paint: 2,328.73 ms +314.24 ms(+15.6%)
…and 9 more (+12 within noise) — details Metric alarms
…and 3 more metric alarms — details Check out the code infra dashboard for more information about this PR. |
8 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Drop React 17 support in v10. React 18 is the new minimum. This PR is for discussion:
masterstill ships v9, so it stays a draft until v10 starts. v9 stays the line for React 17 users.Closes #17637. Follow-up to #24038, which fixed six React 17 crashes in v9.17.0.
Why
reactdownloads.Wins
pnpm-lock.yamland whitespace: 208 insertions, 325 deletions.use-sync-external-storeremoved from 4 packages (x-charts,x-chat-headless,x-data-grid,x-scheduler-internals).@types/use-sync-external-storeremoved from 7 packages. 2 catalog entries removed. The lockfile loses 46 lines.use-sync-external-store/shimimports (4 imports and 1 re-export from@mui/x-data-grid/internals) and 6 hook calls now useReact.useSyncExternalStore.useId: 98 calls in 71 files now useReact.useId()instead of the@mui/utils/useIdand@base-ui/utils/useIdwrappers. 71 wrapper imports removed. The IDs do not change: on React 18+, both wrappers returnReact.useId()as is.ScatterPlotprogressive plan,GridActionsCellmenu button), 8string | undefinedtypes, 13!assertions and 1?? ''fallback.GridHeaderFilterMenuare required again (revert of [DataGridPro] Avoid proptypes warnings with header filters in React 17 #17482).React.*properties) becomes a React 18 guard (6 properties:use,useActionState,useOptimistic,useEffectEvent,Activity,cache).reactMajor < 18skips, 3 dynamicimport('react-dom/client')calls and their comments removed from the SSR tests.@mui/x-tree-view(-73 B, -0.33%).@mui/x-date-pickersgrows by 3 B and@mui/x-licensedoes not change. The gain is small because the shim stays in the bundles:@base-ui/utils/store(useStore) imports it.What stays
@base-ui/utilsand@base-ui/reactkeep their React 17 fallbacks (for exampleuseGlobalIdinuseIdandSafeReact) and theiruse-sync-external-storedependency, because Base UI 1.x supports React 17. 17 MUI X packages depend on@base-ui/utils, so the shim stays in the install tree and in the bundles.useId(idProp)calls keep the wrapper because it merges theidprop (PickersTextField,CalendarGridRoot,EventTimelinePremiumEvent).isReactVersionAtLeast(19)(5 places), theSafeReactread of the React internals inuseDisposable, and thereactMajor < 19and'Activity' in Reacttest branches.@mui/materialand@mui/systempeer ranges do not change in this PR.Changelog
Breaking changes
reactandreact-domto v18 or v19 before you upgrade to MUI X v10. React 17 users can stay on MUI X v9.Generated with Claude Code