[Snackbar] Remove deprecated props#47997
Merged
siriwatknp merged 3 commits intoMar 18, 2026
Merged
Conversation
Netlify deploy preview
Bundle size report
|
mnajdova
reviewed
Mar 17, 2026
| npx @mui/codemod@latest deprecations/snackbar-props <path> | ||
| ``` | ||
|
|
||
| The deprecated `Snackbar` props have been removed. |
Member
There was a problem hiding this comment.
We should list in these migration guide the props removed, to ease up the migration.
49 tasks
siriwatknp
commented
Mar 18, 2026
| } | ||
| slotProps={{ | ||
| content: { | ||
| 'aria-describedby': 'message-id', |
Member
Author
There was a problem hiding this comment.
I take this opportunity to enable this sine DefinitelyTyped/DefinitelyTyped#22582 is merged
silviuaavram
approved these changes
Mar 18, 2026
| - TransitionComponent={CustomTransition} | ||
| - TransitionProps={CustomTransitionProps} | ||
| + slots={{ transition: CustomTransition }} | ||
| + slotProps={{ |
Member
There was a problem hiding this comment.
in the guide we usually made use of actual props we could pass to those slots, should we also have that here?
| @@ -216,11 +187,11 @@ const Snackbar = React.forwardRef(function Snackbar(inProps, ref) { | |||
| getSlotProps: (handlers) => ({ | |||
| onEnter: (...params) => { | |||
| handlers.onEnter?.(...params); | |||
Member
There was a problem hiding this comment.
before removing handleEnter, we called handlers.onEnter and handleEnter had no onEnter because of destrcuturing right? now it's the same, as onEnter is called from handlers. just making sure I understand the flow :D
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
Remove deprecated
Snackbarprops:ClickAwayListenerProps,ContentProps,TransitionComponent,TransitionProps.Users should use
slots/slotPropsinstead.Breaking change
ClickAwayListenerProps→slotProps.clickAwayListenerContentProps→slotProps.contentTransitionComponent→slots.transitionTransitionProps→slotProps.transitionMigration:
Codemod:
Test plan
pnpm proptypes && pnpm docs:apiregenerated