Skip to content

Conversation

@siriwatknp
Copy link
Member

From mui/mui-x#19529

Currently if the type is 'some' | 'value' | (string & {}), the generated prop-types contains object which is not correct:

TestPropTypes.propTypes = {
  operator: PropTypes.oneOfType([
    PropTypes.oneOf([
      "some",
      "value",
    ]),
    PropTypes.object,
  ]).isRequired,
};

The correct code should be:

TestPropTypes.propTypes = {
  operator: PropTypes.string.isRequired,

@mui-bot
Copy link

mui-bot commented Sep 15, 2025

Netlify deploy preview

https://deploy-preview-46934--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%)

Details of bundle changes

Generated by 🚫 dangerJS against 8c09d92

@siriwatknp siriwatknp requested a review from a team September 15, 2025 07:18
Copy link
Contributor

@brijeshb42 brijeshb42 left a comment

Choose a reason for hiding this comment

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

LGTM. How long did this bug last 😂

@siriwatknp
Copy link
Member Author

LGTM. How long did this bug last 😂

Too long 🤣, I can't stand with it anymore.

@siriwatknp siriwatknp enabled auto-merge (squash) September 15, 2025 07:57
@siriwatknp
Copy link
Member Author

@brijeshb42 FYI, just pushed b07532a to fix the CI because those ignore are no longer needed anymore because the produced proptypes will always be string.

@siriwatknp siriwatknp merged commit 7b4e85d into mui:master Sep 15, 2025
18 checks passed
@Janpot
Copy link
Member

Janpot commented Sep 15, 2025

Nice, been looking into this before as well but eventually abandoned it. Thanks for fixing this.

@zannager zannager added the scope: back-infra Involves the back-infra product (https://www.notion.so/mui-org/1a4cbfe7b66080fd824fe175345afbdf). label Sep 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: back-infra Involves the back-infra product (https://www.notion.so/mui-org/1a4cbfe7b66080fd824fe175345afbdf).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants