react-plaid-link
react-plaid-link copied to clipboard
fix: recreate instance immediately
What
- Recreates the Plaid instance immediately in a
useMemo()
rather than auseEffect()
- Trashes the old Plaid instance when unmounting
Why
I have code that takes care of invalidating expired tokens and recreates the Plaid instance when/if needed & since the Plaid token isn't resolved immediately I can't trust the connect.open()
to be immediately pointing to the new token rather than the old one