I am using React Stripe in a React project. I can learn from their documentation that to use Element components and Stripe objects, I need to set Elements provider in the root file of React. And to use Elements provider I need to call loadStripe with the publishable key. I do not want to set this publishable key to a constant value or environment variable. I want to call loadStripe after getting the publishable key as data from the server. In this case, my question is ... 1. After loading the Elements provider in the root file and receiving the key from the server, can loadStripe be called through it? 2. If it is not possible to put it in the root file, then can it be implemented in the other file without the root file like in payment or checkout file?
<Elements stripe={stripePromise}> <App /> </Elements>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)