#Vaibhao

1 messages · Page 1 of 1 (latest)

grizzled tartanBOT
neat dew
#

👋 I'm not an experienced React developer myself so that will not make it easy. You shared pictures. What's your real code, what's the problem?

#

try to load these scripts in index.html
what does that mean?

final trench
neat dew
#

Are you an experienced React developer? Have you used the UMD approach before?

final trench
#

I am experienced React dev, but used UMD approach few times before, this is the standard way of calling script from index.html page.

neat dew
#

Okay, so what errors are you getting exactly?

final trench
#

react-stripe.umd.js:338

   Uncaught TypeError: Cannot read properties of undefined (reading 'createContext')
at react-stripe.umd.js:338:44
at react-stripe.umd.js:4:29
at react-stripe.umd.js:5:2
#

I posted screenshot of error as well

neat dew
#

so what triggers this? just the inclusion of the script? Or you trying to do something with it?

final trench
#

page load triggers this, since it is included in body tag of HTML. Once this script loads fine, I can do rest of my development

neat dew
#

gotcha, I'm having a look

#

@final trench don't you need to include React too?

final trench
#

since react is already part of my app, I don't need to, but I will try adding that.

neat dew
#

yeah locally if we add <!-- React --> <script crossorigin src="https://unpkg.com/react@18/umd/react.production.min.js"></script> <script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script> it works

final trench
#

yeah it is working, thank you for the help @neat dew , much appreciated.