I have a button with action from props:
<div className={classes['Menu__nav-item']}
onClick={props.InformationScroll}
>
Info
</div>
but I want to execute one more action, how to properly do it ?
<div className={classes['Menu__nav-item']}
onClick={props.InformationScroll; () => setFlag(!flag)} #pseudocode
>
Info
</div>
CodePudding user response:
<div className={classes['Menu__nav-item']}
onClick={() => {
props.InformationScroll()
setFlag(!flag)
}} #pseudocode
>
Info
</div>
CodePudding user response:
Just write a separate function and send the relevant parameters with "onClick".