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

CustomSystemProps is not used in SystemProps anymore #35565

Open
2 tasks done
IgnusG opened this issue Dec 21, 2022 · 2 comments
Open
2 tasks done

CustomSystemProps is not used in SystemProps anymore #35565

IgnusG opened this issue Dec 21, 2022 · 2 comments
Labels
bug 🐛 Something doesn't work component: Box The React component. package: system Specific to @mui/system ready to take Help wanted. Guidance available. There is a high chance the change will be accepted

Comments

@IgnusG
Copy link

IgnusG commented Dec 21, 2022

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

Reference to types: https://github.com/mui/material-ui/blob/master/packages/mui-system/src/Box/Box.d.ts#L144

See context below on what I suggest is missing.

Current behavior 😯

Overwriting CustomSystemProps doesn't do anything since it's not actually used anywhere in the code anymore.

Expected behavior 🤔

CustomSystemProps is used in SystemProps so that augmenting it will properly work on components.

Eg. doing:

declare module '@mui/system/Box' {
  interface CustomSystemProps {
    customProp: number;
  }
}

would cause this prop to be available on components such as <Typography customProp={2} />

Specifically modifying packages/mui-system/src/Box/Box.d.ts like this worked:

export type SystemProps<Theme extends object = {}> = {
  [K in StandardSystemKeys]?:
    | ResponsiveStyleValue<AllSystemCSSProperties[K]>
    | ((theme: Theme) => ResponsiveStyleValue<AllSystemCSSProperties[K]>);
} & CustomSystemProps; // Added this bit

Context 🔦

This issue (#25771 (comment)) originally discussed a different issue but the fix seems to have removed the usage of the CustomSystemProps. I would assume this was by accident since this interface is not used anywhere else and could otherwise be removed entirely if it isn't supposed to be used anymore (although I find it useful).

Your environment 🌎

No response

@IgnusG IgnusG added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Dec 21, 2022
@zannager zannager added the component: Box The React component. label Dec 21, 2022
@mnajdova
Copy link
Member

Agree, seems like this is broken now. Would you like to work on a pull request on it, based on #25771 (comment)?

@mnajdova mnajdova added bug 🐛 Something doesn't work package: system Specific to @mui/system ready to take Help wanted. Guidance available. There is a high chance the change will be accepted and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Dec 22, 2022
@IgnusG
Copy link
Author

IgnusG commented Dec 22, 2022

@mnajdova sure I can take a look 👍 Shouldn't be a big change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: Box The React component. package: system Specific to @mui/system ready to take Help wanted. Guidance available. There is a high chance the change will be accepted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants