We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 32a3c0b commit fb6e4a5Copy full SHA for fb6e4a5
dotcom-rendering/src/lib/useIsInView.ts
@@ -42,8 +42,11 @@ type Options = {
42
*/
43
const useIsInView = (
44
options: IntersectionObserverInit & Options,
45
-): [boolean, React.Dispatch<React.SetStateAction<HTMLElement | null>>] => {
46
- const [isInView, setIsInView] = useState<boolean>(false);
+): [
+ boolean | null,
47
+ React.Dispatch<React.SetStateAction<HTMLElement | null>>,
48
+] => {
49
+ const [isInView, setIsInView] = useState<boolean | null>(null);
50
const [node, setNode] = useState<HTMLElement | null>(options.node ?? null);
51
52
const observer = useRef<IntersectionObserver | null>(null);
0 commit comments