I want to call function with paramter from child compponent, i pass the function as a props and when i call this function its get to her but the paramter that i pass to the function is undiffend.
how can i call this function and send to her parmetrs?
here is my code:
perent function:
async function doSomething(param){
//here i see in debug that param is undiffend
var do = param*2
console.log(do)
}
the call of the child componnet:
<child doSomething ={()=>doSomething()}/>
child:
export default function child(props) {
const { doSomething} = props;
return (
<div onClick={() => doSomething(3)}>
<button></button>
</div>
)
}