183
rated 0 times
[
189]
[
6]
/ answers: 1 / hits: 23490
/ 5 Years ago, tue, may 14, 2019, 12:00:00
How can I pass arguments to a function in functional component? As far as I know, creating function in jsx is not good practice right?
function MyComponent(props) {
function handleChange(event, data){
console.log(event.target.value);
console.log(data);
}
return <button onClick={handleClick(??)} value='Foo'>Click</button>
}
More From » reactjs