Skip to content

Commit

Permalink
fix: cr fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MrMuzyk committed Oct 5, 2023
1 parent 460583a commit da85209
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/components/Onfido/index.website.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,31 @@ import lodashGet from 'lodash/get';
import BaseOnfidoWeb from './BaseOnfidoWeb';
import onfidoPropTypes from './onfidoPropTypes';

const Onfido = (props) => {
function Onfido({sdkToken, onSuccess, onError, onUserExit}) {
const baseOnfidoRef = useRef(null);

useEffect(() => {
return () => {
useEffect(
() => () => {
const onfidoOut = lodashGet(baseOnfidoRef.current, 'onfidoOut');
if (!onfidoOut) {
return;
}

onfidoOut.tearDown();
};
}, []);
},
[],
);

return (
<BaseOnfidoWeb
ref={baseOnfidoRef}
{...props}
sdkToken={sdkToken}
onSuccess={onSuccess}
onError={onError}
onUserExit={onUserExit}
/>
);
};
}

Onfido.propTypes = onfidoPropTypes;
Onfido.displayName = 'Onfido';
Expand Down

0 comments on commit da85209

Please sign in to comment.