Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read properties of undefined (reading 'startPayment') #23

Closed
cini9 opened this issue Oct 5, 2022 · 4 comments
Closed

Cannot read properties of undefined (reading 'startPayment') #23

cini9 opened this issue Oct 5, 2022 · 4 comments

Comments

@cini9
Copy link

cini9 commented Oct 5, 2022

Hi Datatrans,

Thanks a bunch for this library and the quick integration into React.

I am facing an issue where I am getting an error message, followed by the lightbox appearing a couple seconds later.

Screenshot 2022-10-05 at 16 04 53

Screenshot 2022-10-05 at 16 05 29

If I integrate the script given in the datatrans documentation (<script src="https://pay.sandbox.datatrans.com/upp/payment/js/datatrans-2.0.0.js">), the lightbox shows up but I cannot click anywhere on the lightbox

I am currently building a Web Application with :
Nextjs v 12.3.0
React v 18.2.0
react-datatrans-light-box v 3.1.0

@pstadler
Copy link
Contributor

pstadler commented Oct 6, 2022

I've never seen this before. Does the example work for you? (npm run example:start)
Can you share some code for us to reproduce this?

@n3ssi3
Copy link
Contributor

n3ssi3 commented Oct 6, 2022

Looks to me like something is re-rendering your view. Please check out our example and your lifecycles.
If the problem persists, provide us with a reproducible code sample.

@jodast
Copy link

jodast commented Oct 11, 2022

I'm running into the same issue using react 18.2.0.
I can reproduce the issue with your example after upgrading to react 18.2.0 (and changing
ReactDom.render( <App />, document.getElementById('app') )
to
ReactDOM.createRoot(document.getElementById("app")).render( <React.StrictMode> <App /> </React.StrictMode> );

image

@pstadler
Copy link
Contributor

This should be fixed with 3.2.0 (already released). Please re-open this issue if it still happens.

Thanks for your report! 🍻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants