RSSAmplifier

Thomas Schoffelen · May 26, 2024

Building Composable React Components

0
Sign in to vote or save

This site does not allow itself to be embedded. You can still read it on the original site — the toolbar below keeps your place in the directory.

Imagine you're building a <Button> component. You might add some props to control the appearance, like variant or size . You end up with a component that looks like this: const Button = ({ variant , size , children }) => { const className = getCorrectStylesFor ( variant , size ); return ( < button className ={ className }> { children } </ button > ); } Okay, but now you run into a problem. This…

Read on schof.co

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.