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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: cashApp not destroyed on unmount #100

Merged

Conversation

testerez
Copy link
Contributor

@testerez testerez commented Feb 6, 2024

Your checklist for this pull request

馃毃Please review the guidelines for contributing to this repository.

  • Make sure you are requesting to pull a topic/feature/bugfix branch (right side). Don't request your master!
  • Make sure you are making a pull request against the main branch (left side). Also you should start your branch off our main.
  • Check the commit's or even all commits' message styles matches our requested structure.
  • Check your code additions will fail neither code linting checks nor unit test.

Description

On our checkout page, we have a back button that will unmount the CashAppPay component. When we try to pay again, we get this error:

Initializing Cash App Pay failed CashAppPayError: already rendered. must destroy before rendering again

This PR is calling cashApp?.destroy(); on useEffect cleanup function so that it's properly destroyed on unmount and works as expected when re-mounting.

@danestves danestves merged commit 5ef2091 into weareseeed:main Feb 6, 2024
9 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants