I'm trying to reference an async function but instead it gets executed.
const Payment = props => {
const [buttonAction, setButtonAction] = useState(null);
useEffect(() => {
if(some true stuff){
// this gets executed instead of being a reference to a function
setButtonAction(() => createSubscription(a ? b : c ));
}
}, [deps...]);
const createSubscription = async (sessionId) => {
// code
}
}