I am implementing Stripe in my project and getting this error on the browser: Failed prop type: The prop `stripeKey` is marked as required in `ReactStripeCheckout`, but its value is `undefined`.
I'm storing my publishable key in a .env file in the client folder:
REACT_APP_STRIPE = pk_mykeykey
And in my component, I've assigned the key to KEY:
const KEY = process.env.REACT_APP_STRIPE
And here's my Stripe component:
name="Lama Shop"
image="https://avatars.githubusercontent.com/u/1486366?v=4"
billingAddress
shippingAddress
description={`Your total is $${cart.total}`}
amount={cart.total * 100}
token={onToken}
stripeKey={KEY}
>
<Button>CHECKOUT NOW</Button>
</StripeCheckout>
I've console.logged the key, it returns undefined and the token also returns null.