DEV Community

loading...

Discussion on: Organizing React

Collapse
guidovizoso profile image
Guido Vizoso

What you can do there is create a base Button component and give it some props. For example title, raised, outline, color, txtColor, fontWeight, etc. Then you just do something like:

const Button = (title, raised, outline, color, txtColor, fontWeight) => {
    <button class={raised ? btn raised : btn}><span>{{title}}</span></button>
    // This is just a quick example, but you get the point, conditional rendering FTW
}