Skip to content

[test] Fix react@18/next nightly CI matrix#48635

Draft
Janpot wants to merge 1 commit into
mui:masterfrom
Janpot:worktree-ci-react-matrix-fixes
Draft

[test] Fix react@18/next nightly CI matrix#48635
Janpot wants to merge 1 commit into
mui:masterfrom
Janpot:worktree-ci-react-matrix-fixes

Conversation

@Janpot

@Janpot Janpot commented Jun 8, 2026

Copy link
Copy Markdown
Member

Fixes the react@18 and react@next nightly CI matrix, which was red across the unit, browser, and visual-regression jobs on master. Each failure is React-version-specific, so they don't surface on the default (React 19 stable) PR runs.

  • test_regressions (react@17/18/next) — the "A11y results committed?" step ran an unscoped git diff --exit-code, but these jobs pin React via package-overrides, which rewrites package.json/pnpm-lock.yaml and tripped the check. The a11y results are React-version independent, so the check now only runs on the default React job.
  • ListItemslotProps.root was typed as plain HTMLAttributes, so the generated propType was PropTypes.object and rejected the callback form that the conformance slotProps.root test passes (a warning under React 18, which still validates propTypes). Typed it as SlotProps like the other slots and regenerated propTypes.
  • TabTab must render as a direct child of Tabs, which injects state into its children via cloneElement (fullWidth, indicator, selected, …). The theme-wrapping conformance tests wrap the element in a ThemeProvider, so Tabs clones the provider with those props and trips its exactProp check under React 18. Unlike other nested components (Step, MenuItem, …) which pass parent state via context, Tabs is the odd one out, so these conformance checks don't apply to Tab and are skipped.
  • useValueAsRef — the ref-identity test latched its first reference during the initial render, capturing the transient object that React 18 StrictMode discards on its mount/remount. It now reads the ref after each render settles.

Verified locally against both React 18.3.1 and React 19.2.6 (node and chromium).

Note: the InitColorSchemeScript react@next failures from the same nightly are already handled by #48604.

@code-infra-dashboard

code-infra-dashboard Bot commented Jun 8, 2026

Copy link
Copy Markdown

Deploy preview

https://deploy-preview-48635--material-ui.netlify.app/

Bundle size

Bundle Parsed size Gzip size
@mui/material 0B(0.00%) 0B(0.00%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/private-theming 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

- test_regressions: skip the 'A11y results committed?' git-clean check on the
  react@17/18/next jobs, which pin React via package-overrides and so dirty
  package.json/pnpm-lock.yaml.
- ListItem: type slotProps.root as SlotProps so it accepts a callback (matches
  the conformance slotProps-callback test); regenerated propTypes.
- Tab: skip the theme-wrapping conformance tests. They wrap the element in a
  ThemeProvider, which Tabs then clones with Tab-internal props (fullWidth,
  indicator, …), tripping ThemeProvider's exactProp under React 18.
- useValueAsRef: read the ref after each render settles so React 18 StrictMode's
  mount/remount doesn't skew the identity comparison.
@Janpot Janpot force-pushed the worktree-ci-react-matrix-fixes branch from d624e6d to 70d5444 Compare June 8, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant