Repository navigation
[stepper] Stop forwarding elevation and square to the DOM - #49987
Open
siriwatknp wants to merge 1 commit into
Open
siriwatknp wants to merge 1 commit into
siriwatknp wants to merge 1 commit into
Conversation
Deploy previewBundle size
PerformanceNo regressions in 32 benchmarks · precise to ±3.1% (±6.7% at worst) · ran 1m 59s · details Check out the code infra dashboard for more information about this PR. |
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.
Summary
Stepper renders
elevationandsquareas HTML attributes on its<ol>root.<Stepper elevation={3} square>produces<ol elevation="3" square>, and React logs a warning:The two props are left over from when Stepper rendered a Paper. #22564 removed the Paper, but
StepperPropsstill pickselevationandsquarefromPaperProps, so TypeScript accepts them. Stepper never used them, so they went to the root element with the other props.Stepper now takes both props out before spreading the rest onto the root, so they no longer reach the DOM. The types are unchanged, so code that passes them still compiles. Removing them from the types is a breaking change and can wait for v10.
For reviewers
elevationandsquareare destructured in Stepper.js, so the proptypes script now generates propTypes for them. Adding Stepper toignoreExternalDocumentationinscripts/generateProptypes.tsmarks them@ignore. They stay off the Stepper API page because they have no effect.varianthas the same problem. [material-ui] Add own variant overrides to Card, Accordion, AppBar, SnackbarContent, Stepper and TablePagination #49980 fixes it, along with giving Stepper its ownvarianttype.<Stepper elevation={3} square>and checks that the<ol>has neither attribute. It failed before the fix, both on theelevationattribute and on the React warning forsquare.