lulus teks ke komponen tombol bereaksi
// general component
<ButtonComponent text="General" />
// button component
const ButtonComponent = (props) => {
const handleClick = () => {
console.log(props.text);
};
return (
<button onClick={ handleClick }>{ props.text }</button>
);
};
Marton