mirror of
https://github.com/streamich/react-use.git
synced 2026-01-18 14:06:52 +00:00
fix: iframe can be null
This commit is contained in:
parent
8f04e8fd5c
commit
a9e3bab280
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user