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

fix: prevents multiple init calls during re-renders #232

Merged
merged 1 commit into from
Feb 16, 2024
Merged

Conversation

kevinperaza
Copy link
Contributor

Description

Testing required outside of automated testing?

  • Not Applicable

Screenshots (if appropriate):

  • Not Applicable

Rollback / Rollforward Procedure

  • Roll Forward
  • Roll Back

Reviewer Checklist

  • Description of Change
  • Description of outside testing if applicable.
  • Description of Roll Forward / Backward Procedure
  • Documentation updated for Change

@kevinperaza kevinperaza requested a review from a team as a code owner February 16, 2024 00:41
Copy link

Coverage Report

Totals Coverage
Statements: 91.23% ( 156 / 171 )
Methods: 100% ( 32 / 32 )

@kevinperaza kevinperaza merged commit 20b7d27 into master Feb 16, 2024
2 checks passed
@kevinperaza kevinperaza deleted the bugfix branch February 16, 2024 01:01
@talberkoMelio
Copy link

@kevinperaza

When using like this:
const { bt, error } = useBasisTheory(services.tbt.apiKey , { elements: true });

The options object is getting new ref in memory for each rerender, then because it is used as dependency in the useEffect on your hook, it will trigger initialization each rerender until bt object is initialized. you can use the isLoading or any another solution for example compare options, or use the options values as dependency and not the whole object.

@bt-platform-eng
Copy link

🎉 This PR is included in version 1.16.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

None yet

4 participants