Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it

updated Oct 2, 2021created Oct 2, 2021
js
// ❌ // const stripePromise = loadStripe(process.env.NEXT_PUBLIC_STRIPE_PUBLIC_KEY); // 🙆‍♂️ const [stripePromise, setStripePromise] = useState(() => loadStripe(process.env.NEXT_PUBLIC_STRIPE_PUBLIC_KEY))