skip to Main Content

Can variables be passed to React handler in TypeScript?

I wanted to pass a variable (SearchBoolean) to be logged everytime a button handler function is invoked. So I did this: type SearchFormProps = { styles: React.CSSProperties; classNames: string; }; const onSubmitHandler=(event: React.SyntheticEvent, isSearched?:boolean)=>{ event.preventDefault(); const target = event.target as…

VIEW QUESTION
Back To Top
Search