I want to call function apiCall() every time the Cancel button is clicked and setSave() and setCreate() functions conditionally. Is there any way other than the wrapper function that I can use. I am using Functional component and setSave and setCreate functions are useState functions and apiCall() is a function which I have received as a prop from parent function.
<input type="button" onClick={() => (id !== '' ? setSave(true) : setCreate(false))} value="Cancel" />