pass text to button component react
// general component
<ButtonComponent text="General" />
// button component
const ButtonComponent = (props) => {
const handleClick = () => {
console.log(props.text);
};
return (
<button onClick={ handleClick }>{ props.text }</button>
);
};