Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Slots to rating #45295

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

harry-whorlow
Copy link
Contributor

part of #41281

This PR adds slot the slot prop to rating, whilst deprecating components.

props.iconContainerComponent -> slot.iconContainer

[/] I have followed (at least) the PR section of the contributing guide.

@harry-whorlow harry-whorlow changed the title Add Slots and SlotProps to rating Add Slots to rating Feb 12, 2025
@mui-bot
Copy link

mui-bot commented Feb 12, 2025

Netlify deploy preview

https://deploy-preview-45295--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against dab6cfb


export interface RatingOwnProps {
export interface RatingOwnProps extends RatingSlotsAndSlotProps {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@siriwatknp @DiegoAndai is this the correct place to extend with RatingSlotsAndSlotProps? pnpm proptypes isn't generating the relevant docs for slots and slotProps in rating.js

Cant see what i've missed, a hint would be greatly appreciated 🤟

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @harry-whorlow!

Try following Accordion.d.ts implementation:

} & AccordionSlotsAndSlotProps;

Does that work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DiegoAndai, no still the same 🙃

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has to be added to the RatingTypeMap, not RatingOwnProps, does it work with that change?

Copy link
Contributor Author

@harry-whorlow harry-whorlow Feb 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DiegoAndai yeah, thats what I did. Here is the commit changes dab6cfb.

line 163 of rating.d.ts, it still only updates the deprecated line in the rating.js and completely ignores the slots.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants