You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Sam-Kruglov Thank you for reporting -- this PR leads me to believe that this behavior may be by design: #197 -- can you take a look and see if that addresses your issue?
I see, the problem is on my side because I didn't handle the !ready case. I ended up moving all that stuff into a custom hook:
functionuseAccountImportViaPlaidLinkWidget({ token }: Readonly<{token: string|null}>): [{opening: booleanisOpen: booleanready: booleanopen: ()=>voiderror: MyError|null},// plaid stuff{importing: booleanerror: ApolloError|null}// my stuff running in onSuccess and setting some states]{...}
Perhaps we can turn this issue into improvement suggestions:
Provide opening, isOpen
I'm not sure if that's the current behavior already but I think the error flow is confusing, I parsed all 3 cases into the same format and returned it into the same variable like a ?: b|c (only b or c happens at once I think, so I have one useState for those)
a. error returned from usePlaidLink
b. onEvent where eventName === PlaidLinkStableEvent.ERROR
c. onExit where err != null
The text was updated successfully, but these errors were encountered: