Answer the question
In order to leave comments, you need to log in
Which argument to pass first in onClick Typescript?
Hello,
Is there such a function?
const onChangeHandler = (e:React.FormEvent<HTMLAnchorElement>, id:any) => {
e.preventDefault()
console.log(id)
}
return(
<li key={index}>
<a href={"#"} onClick={onChangeHandler(Category.id)} >{Category.name}</a>
</li>
)
Answer the question
In order to leave comments, you need to log in
onClick={(event: any) => onChangeHandler(event, Category.id)}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question