Skip to content

Wallet rendering twice? #66

Closed Answered by ignaciolarranaga
ignaciolarranaga asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks @icaldana. I found the problem.

I'm using NextJS so I can not really import the library directly (because of this: #52). I tried the suggestion here: #52 (reply in thread) but the initMercadoPago loaded dynamically interferes with the wallet rendering triggering the re-render causing the buttons to duplicate. I tried moving the initMercadoPago away from the wallet rendering but the "dynamic approach" ultimately causes the same interference.

The best solution I was able to find was to load the library dynamically, then run the initialization and create the component.
Sharing in case useful:

export default function PayButtons({
  countryCode,
  copyId,
  inPersonPickup,
}: PayButtons…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@icaldana
Comment options

Answer selected by icaldana
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants