-
Notifications
You must be signed in to change notification settings - Fork 157
Open
Description
Hi there!
I've noticed that iframe that is created by usePlaidLink hook is not removed on successful scenario, so when I start plaid linking process multiple times - a new iframe is created each time. The only case when iframe is not recreated is when I close plaid link window and onError callback is triggered.
I've noticed that this behaviour happens because usePlaidLink effect fires an exit method on unmout, but destroy callback is not triggered:

React component to reproduce:
import React, { useEffect } from 'react';
import { PlaidLinkOptions, usePlaidLink } from 'react-plaid-link';
interface PlaidLinkProps {
options: PlaidLinkOptions;
}
export const PlaidLink: React.FC<PlaidLinkProps> = ({ options }) => {
const { open, ready } = usePlaidLink(options);
useEffect(() => {
if (ready) {
open();
}
}, [ready]);
useEffect(() => {
return () => {
console.log('unmount');
};
}, []);
return (<></>);
};Metadata
Metadata
Assignees
Labels
No labels