Size Prop
Loading "Size Prop"
Size Prop
Run locally for transcripts
π¨βπΌ It's great that we're composing the
classNames and styles properly, but
wouldn't it be better if the users of our components didn't have to worry about
which class name to apply for a given effect? Or that a class name is involved
at all? I think it would be better if users of our component had a size prop
and our component took care of making the box that size.In this step, try to make this API work:
<Box size="small" style={{ backgroundColor: 'lightblue' }}>
small lightblue box
</Box>
- You'll need π TypeScript's intersection (&) operator