-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[system] Allow function type for sx
prop
#29198
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not work.
<Tab
label="Item One"
sx={(theme) => ({
...theme.typography.h6,
p: 10,
})}
/>
I think you have to update styleFunctionSx.js
implementation a bit. Also, please add a test to verify that it works.
My suggestion for the next PR contains a lot of file changes. first commit should be the implementation change and the next commit can be the command or script running. This is easier to review. 👍
a8e70f1
to
d55c679
Compare
@siriwatknp Hey! I updated the code and the code sandbox. |
Nice, can you add one more test case to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Awesome.
If that is the only problem, then why does this PR change the implementation? The problem is purely about propTypes (and probably TypeScript). There was no mention that the behavior is incorrect. |
@eps1lon
|
983e291
to
9098874
Compare
Closes #27492
This PR enables
sx
prop to accept a function type in addition to object type.Code sandbox: https://codesandbox.io/s/basictabs-material-demo-forked-dwslp?file=/demo.js