[accordion] Remove deprecated props by silviuaavram · Pull Request #47963 · mui/material-ui (original) (raw)
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);