diff --git a/snippets/useEventListener.md b/snippets/useEventListener.md index 80f3e2028..7411b43d4 100644 --- a/snippets/useEventListener.md +++ b/snippets/useEventListener.md @@ -9,7 +9,7 @@ Adds an event listener for the specified event type on the given element. - Use the `useRef()` hook to create a ref that will hold the `handler`. - Use the `useEffect()` hook to update the value of the `savedHandler` ref any time the `handler` changes. - Use the `useEffect()` hook to add an event listener to the given element and clean up when unmounting. -- Omit the last argument, `el`, to use the `window` by default. +- Omit the last argument, `el`, to use the `Window` by default. ```jsx const useEventListener = (type, handler, el = window) => { diff --git a/snippets/useFetch.md b/snippets/useFetch.md index b8e03c8e2..16e2359ee 100644 --- a/snippets/useFetch.md +++ b/snippets/useFetch.md @@ -5,7 +5,7 @@ firstSeen: 2019-08-21T14:23:57+03:00 lastUpdated: 2021-01-07T23:57:13+02:00 --- -Implements `fetch` in a declarative manner. +Implements `fetch()` in a declarative manner. - Create a custom hook that takes a `url` and `options`. - Use the `useState()` hook to initialize the `response` and `error` state variables. diff --git a/snippets/useIntersectionObserver.md b/snippets/useIntersectionObserver.md index 789e6d3d5..36e1523c0 100644 --- a/snippets/useIntersectionObserver.md +++ b/snippets/useIntersectionObserver.md @@ -7,7 +7,7 @@ firstSeen: 2021-09-10T05:00:00-04:00 Observes visibility changes for a given element. - Use the `useState()` hook to store the intersection value of the given element. -- Create an `IntersectionObserver()` with the given `options` and an appropriate callback to update the `isIntersecting` state variable. +- Create an `IntersectionObserver` with the given `options` and an appropriate callback to update the `isIntersecting` state variable. - Use the `useEffect()` hook to call `IntersectionObserver.observe()` when mounting the component and clean up using `IntersectionObserver.unobserve()` when unmounting. ```jsx diff --git a/snippets/useInterval.md b/snippets/useInterval.md index f58e75b07..0d6cf7b99 100644 --- a/snippets/useInterval.md +++ b/snippets/useInterval.md @@ -5,7 +5,7 @@ firstSeen: 2019-08-21T13:18:52+03:00 lastUpdated: 2020-11-16T14:17:53+02:00 --- -Implements `setInterval` in a declarative manner. +Implements `setInterval()` in a declarative manner. - Create a custom hook that takes a `callback` and a `delay`. - Use the `useRef()` hook to create a `ref` for the callback function. diff --git a/snippets/useIsomporphicEffect.md b/snippets/useIsomporphicEffect.md index cbdf7a813..014adaf36 100644 --- a/snippets/useIsomporphicEffect.md +++ b/snippets/useIsomporphicEffect.md @@ -7,7 +7,7 @@ lastUpdated: 2021-10-13T19:29:39+02:00 Eesolves to `useEffect()` on the server and `useLayoutEffect()` on the client. -- Use `typeof` to check if the `window` object is defined. If it is, return the `useLayoutEffect()`. Otherwise return `useEffect()`. +- Use `typeof` to check if the `Window` object is defined. If it is, return the `useLayoutEffect()`. Otherwise return `useEffect()`. ```jsx const useIsomorphicEffect =