[Box] Add back system props#24485
Conversation
|
@material-ui/core: parsed: +0.08% , gzip: +0.10% |
|
After the PR is merged, I'll add more benchmarks for the system props too. |
oliviertassinari
left a comment
There was a problem hiding this comment.
Will we use the same approach to implement the props on the Typography or Grid component?
That's the plan, that's why I've added the |
| * @ignore - do not document. | ||
| */ | ||
| const Box = React.forwardRef(function Box(props, ref) { | ||
| const BoxInner = React.forwardRef((props, ref) => { |
There was a problem hiding this comment.
I assume we will be able to remove this inner component later down the road.
There was a problem hiding this comment.
Hopefully yes. I had it inlined first, but I needed to add propTypes on it, that’s why I’ve extracted it..
Co-authored-by: Olivier Tassinari <[email protected]>
Co-authored-by: Olivier Tassinari <[email protected]>
This PR adds back the system props in the Box component. However ,the implementation is a bit different than the previous one. For it to work, I am just extending the value of the sx prop, by adding all system props at the start of the
sxobject. This means that the value of the sx prop will override these props consistently, which is what we want I believe.TODO: