[codemod] Fix incorrect slot name in tab-props.js (scrollButton → scrollButtons)
Summary
This PR fixes an incorrect slot name in the mui-codemod transformer for Tabs props.
In tab-props.js, the codemod currently moves TabScrollButtonProps into a slot named scrollButton (singular).
However, according to the Tabs API, the correct slot is scrollButtons (plural).
Netlify deploy preview
https://deploy-preview-47215--material-ui.netlify.app/
Bundle size report
| Bundle | Parsed size | Gzip size |
|---|---|---|
| @mui/material | 0B(0.00%) | 0B(0.00%) |
| @mui/lab | 0B(0.00%) | 0B(0.00%) |
| @mui/system | 0B(0.00%) | 0B(0.00%) |
| @mui/utils | 0B(0.00%) | 0B(0.00%) |
Generated by :no_entry_sign: dangerJS against 5260500b4e5c46cbf7a420e15def9b458040754f
@ZeeshanTamboli @sai6855 Please check this PR.
@siriwatknp I am confused. Should it be scrollButton or scrollButtons. In MUI Docs, it is scrollButtons but ideally it should be scrollButton
@siriwatknp I am confused. Should it be scrollButton or scrollButtons. In MUI Docs, it is scrollButtons but ideally it should be scrollButton
In the code it's plural: https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Tabs/Tabs.js#L575C63-L575C76
@ZeeshanTamboli I tried pushing the empty commit but the CI is not getting triggered
@siriwatknp There's a lot of inconsistency here.
- In the TS type, it is
scrollButtonslot (singular): https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Tabs/Tabs.d.ts#L101 - In the
useSlotimplementation it isscrollButtons(plural): https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Tabs/Tabs.js#L575 as pointed by @mj12albert - But in the
externalForwardedPropsit isscrollButton(singular): https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Tabs/Tabs.js#L387 - And in the migration docs it is
scrollButton(singular): https://mui.com/material-ui/migration/migrating-from-deprecated-apis/#scrollbuttoncomponent
@siriwatknp Any reponse on this?
In the TS type, it is scrollButton slot (singular)
It's plural, please check again -> https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Tabs/Tabs.d.ts#L101
But in the externalForwardedProps it is scrollButton (singular)
I think this is a bug, it should be plural (same as defined useSlot)
And in the migration docs it is scrollButton (singular)
Looks wrong to me, should be plural too.
@ZeeshanTamboli can you do the fixes, it can be in this PR (please also add a test for the scrollButtons slot to ensure that slotProps.scrollButtons pass through).