chargebee / chargebee-js-wrappers

25 stars 10 forks source link

Not able to create the instance while using @chargebee/chargebee-js-react-wrapper #132

Open mcarry1 opened 1 year ago

mcarry1 commented 1 year ago

I am using @chargebee/chargebee-js-react-wrapper in react project i added below code in index.html

and using the CardComponent in different file but i am getting Cannot read properties of undefined (reading 'init')

image

damyco commented 12 months ago

You are probably trying to initialise chargebee before the script it's loaded. Try loading the script first and then use useEffect on mount only to init the instance.