Skip to content

Commit

Permalink
Update src/components/createElementComponent.tsx
Browse files Browse the repository at this point in the history
Co-authored-by: fruchtose-stripe <[email protected]>
  • Loading branch information
jima-stripe and fruchtose-stripe authored Jun 16, 2023
1 parent fce3440 commit d603890
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/components/createElementComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,16 +173,16 @@ const createElementComponent = (

React.useLayoutEffect(() => {
return () => {
try {
if (
elementRef.current &&
typeof elementRef.current.destroy === 'function'
) {
if (
elementRef.current &&
typeof elementRef.current.destroy === 'function'
) {
try {
elementRef.current.destroy();
elementRef.current = null;
} catch (error) {
// Do nothing
}
} catch (error) {
// Do nothing
}
};
}, []);
Expand Down

0 comments on commit d603890

Please sign in to comment.