skipSx should update shouldForwardProps
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 99.1k
- Forks
- 32.5k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 106
Description
Duplicates
- I have searched the existing issues
Latest version
- I have tested the latest version
Summary 💡
The skipSx doesn't work as expected when shouldForwardProp default mechanism is overwritten and does not include 'sx' directly
shouldForwardProp: (prop) => !["isEven"].includes(prop as string),
skipSx: true
This will send sx to the underlying component
Examples 🌈
I made a code sandbox using the latest released material
https://codesandbox.io/s/goofy-phoebe-xc99x
Motivation 🔦
making a custom component that only changes in CSS layer duo to props is a common practice
also, sx seems to be a little bit slow, and skipping it may gain some performance tips
so because we are working mostly with the Mui component and they pass the props to the underling dom node, it makes sense to have it as a core feature of the material
I seared on skipSx tags in the issue list and could not find an open issue, so posted a new one.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked CodeSandbox reproduction and trace the implementation of skipSx together with the default shouldForwardProp behavior. Confirm the fix by checking that sx is not passed to the underlying component when a custom shouldForwardProp omits it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100