[react-dom] Support maskType SVG prop#35921
Merged
eps1lon merged 1 commit intofacebook:mainfrom Feb 27, 2026
Merged
Conversation
Add maskType → mask-type to the SVG attribute alias map so React correctly renders <mask maskType="luminance"> as mask-type="luminance" on the DOM element instead of the unrecognized camelCase prop. Also add the masktype → maskType entry in possibleStandardNames so the development warning points users to the correct camelCase spelling. Fixes: facebook#35920 MDN reference: https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Attribute/mask-type
maskType SVG prop as mask-type
maskType SVG prop as mask-typemaskType SVG prop
maskType SVG propmaskType SVG prop
|
Comparing: b4a8d29...f54905d Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: (No significant changes) |
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
React currently does not recognize the
maskTypeprop on SVG elements, causing:maskType="luminance") rather than the correctmask-type="luminance"maskTypeprop on a DOM element"The SVG
mask-typeattribute is valid per MDN and specifies whether a mask is used as a luminance or alpha mask.Changes
getAttributeAlias.js: Add['maskType', 'mask-type']to the SVG attribute alias map (alphabetically betweenmarkerStartandoverlinePosition)possibleStandardNames.js: Addmasktype: 'maskType'entry so the dev-mode warning correctly suggests the camelCase spellingTest
Fixes #35920