You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm fetching my amount and apikey from an API, but for some reason, the paystack ref uses the initial values of the states
const[paystackKey,setPaystackKey]=useState('');const[amount,setAmount]=useState(0);constpaystackWebViewRef=useRef();useEffect(()=>{setAmount(100000);setPaystackKey('ps...........');},[]);<PaystackWebViewshowPayButton={false}paystackKey={paystackKey}amount={amount}billingEmail={user.email}billingMobile={user.telephone}billingName={user.firstName}ActivityIndicatorColor="green"refNumber={Math.floor((Math.random()*1000000000)+1)}ref={paystackWebViewRef}onSuccess={(tranRef: any)=>{confirmPayment(tranRef);}}onCancel={()=>{console.log('something went wrong');}}/>
So on payment, the paystack key would empty and the amount still zero. Any help will be useful @just1and0 .
The text was updated successfully, but these errors were encountered:
I'm fetching my amount and apikey from an API, but for some reason, the paystack ref uses the initial values of the states
So on payment, the paystack key would empty and the amount still zero. Any help will be useful @just1and0 .
The text was updated successfully, but these errors were encountered: