[accordion] Remove deprecated props#47963
Conversation
Netlify deploy previewBundle size report
|
There was a problem hiding this comment.
Pull request overview
Removes previously-deprecated Accordion transition customization props (TransitionComponent, TransitionProps) as part of the v9 API surface, standardizing on the slots/slotProps customization model.
Changes:
- Remove
TransitionComponent/TransitionPropsfromAccordionimplementation, TS types, PropTypes, and API docs. - Update
Accordiontests to useslots.transition/slotProps.transition. - Document the breaking removal in the v9 upgrade guide.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/mui-material/src/Accordion/Accordion.js | Removes legacy transition props wiring and PropTypes entries. |
| packages/mui-material/src/Accordion/Accordion.d.ts | Removes legacy transition props from the public TypeScript API. |
| packages/mui-material/src/Accordion/Accordion.test.js | Migrates tests from legacy props to slots/slotProps. |
| docs/pages/material-ui/api/accordion.json | Removes legacy props from generated API docs JSON. |
| docs/data/material/migration/upgrade-to-v9/upgrade-to-v9.md | Adds v9 migration notes for the removed props. |
Comments suppressed due to low confidence (1)
packages/mui-material/src/Accordion/Accordion.test.js:252
- Now that the legacy
TransitionComponent/TransitionPropsprops are removed, it would be good to add a regression test asserting they are not forwarded to the DOM (e.g., rendering<Accordion TransitionComponent={...} />should not set aTransitionComponentattribute on the root). This will catch accidental reintroductions of React unknown-prop warnings while still allowing apps to upgrade incrementally.
describe('slotProps.transition', () => {
it('should apply properties to the Transition component', () => {
render(
<Accordion slotProps={{ transition: { 'data-testid': 'transition-testid' } }}>
{minimalChildren}
</Accordion>,
);
expect(screen.getByTestId('transition-testid')).not.to.equal(null);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
0e8b4ba to
1b6f975
Compare
| ``` | ||
|
|
||
| #### Accordion deprecated props removed | ||
|
|
There was a problem hiding this comment.
Link accordion-props codemod here like https://master--material-ui.netlify.app/material-ui/migration/upgrade-to-v9/#deprecated-apis-removed which is for Autocomplete.
1b6f975 to
b3474b2
Compare
Removes accordion deprecated props, the changes are done by agent.