Without any error the setClientSecret() unable to set the clientSecret, returns only initial value as truein console.
Payment.js file
`import React,{useState, useEffect} from 'react';
import './Payment.css';
import {useStateValue} from './StateProvider';
import CheckoutProduct from './CheckoutProduct.js';
import {Link, useHistory} from 'react-router-dom';
import {CardElement, useStripe, useElements} from '@stripe/react-stripe-js';
import CurrencyFormat from 'react-currency-format';
import {getBasketTotal} from './reducer';
import axios from './axios';
import { db } from '..firebase/firebase';
Without any error the setClientSecret() unable to set the clientSecret, returns only initial value as truein console.
Payment.js file
`import React,{useState, useEffect} from 'react'; import './Payment.css'; import {useStateValue} from './StateProvider'; import CheckoutProduct from './CheckoutProduct.js'; import {Link, useHistory} from 'react-router-dom'; import {CardElement, useStripe, useElements} from '@stripe/react-stripe-js'; import CurrencyFormat from 'react-currency-format'; import {getBasketTotal} from './reducer'; import axios from './axios'; import { db } from '..firebase/firebase';
const Payment = () => { const [{basket, user}, dispatch] = useStateValue(); const history = useHistory();
}
export default Payment;`