Documente Academic
Documente Profesional
Documente Cultură
React
React
console.log('Label 👉️
', event.target.selectedOptions[0].label);
console.log(event.target.value);
setSelected(event.target.value);
};
return (
<div>
<select value={selected} onChange={handleChange}>
<option value="">--Choose and option--</option>
<option value="apple">Apple 🍏</option>
onClick
return (
<div>
<p>{count}</p>
<button
onClick={() => {
sayHello();
setCount(count + 1);
}}
>
Say Hello and Increment
</button>
</div>
);
};
return (
<button onClick={() => { sayHello("Yomi"); } } >
Say Hello
</button>
);
};