diff --git a/index.js b/index.js index b6fb1ae..6d6bd11 100644 --- a/index.js +++ b/index.js @@ -4,7 +4,7 @@ import { PropTypes } from 'prop-types'; class PlaidAuthenticator extends Component { render() { - const {publicKey, selectAccount, env, product, clientName, webhook, style, token} = this.props; + const {publicKey, selectAccount, env, product, clientName, webhook, style, token, onLoadEnd} = this.props; let uri = `https://cdn.plaid.com/link/v2/stable/link.html?key=${publicKey}&apiVersion=v2&env=${env}&product=${product}&clientName=${clientName}&isWebView=true&isMobile=true&webhook=${webhook}&selectAccount=${selectAccount}` uri = token !== undefined ? `${uri}&token=${token}` : uri @@ -32,6 +32,7 @@ class PlaidAuthenticator extends Component { source={{uri}} onMessage={(e) => this.onMessage(e)} injectedJavaScript={patchPostMessageJsCode} + onLoadEnd={onLoadEnd ? onLoadEnd : () => {}} /> } @@ -63,6 +64,7 @@ class PlaidAuthenticator extends Component { PlaidAuthenticator.defaultProps = { publicKey: PropTypes.string.isRequired, onMessage: PropTypes.func.isRequired, + onLoadEnd: PropTypes.func, env: PropTypes.string.isRequired, product: PropTypes.string.isRequired, clientName: PropTypes.string,