Repository navigation
fix: preserve explicitly passed undefined props - #5683
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: 8bdb9a3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
When a user explicitly passes a prop as undefined (e.g., role={undefined}),
attrs no longer overwrites it. This allows resetting inherited defaults,
fixing compatibility with libraries like MUI and Radix UI.
Props set to undefined via .attrs() without an explicit user prop are
still stripped as before.
Closes #4338
quantizor
force-pushed
the
fix/undefined-props-passthrough
branch
from
March 19, 2026 05:34
8522983 to
8bdb9a3
Compare
quantizor
marked this pull request as ready for review
March 19, 2026 05:38
quantizor
added a commit
that referenced
this pull request
May 9, 2026
ContainerPublisher (the wrapper mounted when `$containerName` is set) used to mutate the cached `elementProps.onLayout` in place, so each full-cache-hit re-render wrapped the previously-composed handler again. After N re-renders, the user's onLayout fired N+1 times per layout event. Clone the props object before assigning the composed handler. Native `resolveContext` was missing the explicit-`undefined`-overrides- attrs guard that web has had since #5683. Mirror the web check so `<Comp prop={undefined} />` opts out of an attrs-provided default. `parseMediaQuery` cached parsed Query results in an unbounded `Map`; long-lived sessions that interpolated runtime variation (`@media (min-width: ${px}px)`) would leak. Switch to the same FIFO-evicting discipline the parser uses for its other per-string caches. Wrap the RSC compiler/plugin override slot in `React.cache` so true Flight rendering scopes the slot per request rather than process-wide. The pre-existing `__resetRSCOverrideForTesting` shim still works for non-Flight test setups (regular `renderToString` doesn't activate `React.cache`).
7 of 8 tasks
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.
Summary
undefinedvalues that came from.attrs()(to enable removing props via attrs)undefinedprops are now preserved, fixing compatibility with libraries like MUI and Radix UI that passundefinedto reset inherited defaults (e.g.,role={undefined})Test plan
role={undefined}patternCloses #4338