I'm SO frustrated. I'm literally implementing straight from the Stripe Docs, and I keep getting the error
Error: Invalid prop 'stripe' supplied to 'Elements'. We recommend using the 'loadStripe' utility from '@stripe/stripe-js'
... but I am! What is wrong with this script? I've searched everywhere, and can not find any reason why I'm getting this error.
import React from "react"
import PropTypes from "prop-types"
import {loadStripe} from '@stripe/stripe-js';
import {CardElement, Elements, useElements, useStripe} from '@stripe/react-stripe-js';
const stripePromise = loadStripe('pk_test_yesItsMyRealKey')
class MembershipCheckout extends
React.Component {
render() {
return(
<Elements stripe={stripePromise}>
</Elements>
)
}
}
export default MembershipCheckout;
package.json
"@stripe/react-stripe-js": "^1.1.2",
"@stripe/stripe-js": "^1.11.0",
Not sure if it matters, but i'm using Rails 6, with react-rails and webpacker