You might want to put some logs in the useEffect block to confirm if initStripe is called before initializePaymentSheet and openPaymentSheet.
useEffect
initStripe
initializePaymentSheet
openPaymentSheet