CarsonMatz / ButtonExperimenting

Code for responsive button component.
0 stars 0 forks source link

Div children #2

Open l-monninger opened 2 years ago

l-monninger commented 2 years ago

I no longer want the children of my button to be the text node Testing. In fact, for now, I want to support arbitrary children. They could be images, buttons, iframes, any crazy thing I can think of. How do I do this?

export const Button : FC<ButtonProps>  = ({
    style,
    onMouseOver,
    onClick,
    variant = 'default',
    size = 'md',
}) =>{

    return (
        <div
        className={BUTTON_CLASSNAMES}
        onClick={onClick}
        style={{...BUTTON_STYLE, ...style}}>
            Testing
        </div>
    )
};
CarsonMatz commented 2 years ago

Changed it so the displayed text can be set to anything from App.jsx