Right now I am trying to make a reusable button component where I can pass in a color prop to set the background depending on what component it is in.
CustomButton.js
const CustomButton = ({ children, link, color }) => {
return (
<a href={link}>
<button className={styles.customButton} backgroundColor={color}>
{children}
</button>
</a>
);
};
App.js
<CustomButton link='/' color='red'>Test</CustomButon>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…