fix: iframe can be null

This commit is contained in:
Vadim Dalecky 2019-07-07 15:42:38 +02:00 committed by GitHub
parent 8f04e8fd5c
commit a9e3bab280
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,7 +45,7 @@ const useSize = (
};
useEffect(() => {
const iframe: HTMLIFrameElement = ref.current;
const iframe: HTMLIFrameElement | null = ref.current;
if(!iframe) {
// iframe will be undefined if component is already unmounted