diff --git a/snippets/useIsomporphicEffect.md b/snippets/useIsomporphicEffect.md index d5481a6c1..3cd57e482 100644 --- a/snippets/useIsomporphicEffect.md +++ b/snippets/useIsomporphicEffect.md @@ -8,7 +8,7 @@ firstSeen: 2021-09-29T05:00:00-04:00 lastUpdated: 2021-10-13T19:29:39+02:00 --- -Eesolves to `useEffect()` on the server and `useLayoutEffect()` on the client. +Resolves 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()`. diff --git a/snippets/usePortal.md b/snippets/usePortal.md index 1eab81695..ea814275f 100644 --- a/snippets/usePortal.md +++ b/snippets/usePortal.md @@ -9,7 +9,7 @@ firstSeen: 2022-01-05T05:00:00-04:00 Creates a portal, allowing rendering of children outside the parent component. -- Use the `useState()` hook to create a state varible that holds the `render()` and `remove()` functions for the portal. +- Use the `useState()` hook to create a state variable that holds the `render()` and `remove()` functions for the portal. - Use `ReactDOM.createPortal()` and `ReactDOM.unmountComponentAtNode()` to create a portal and a function to remove it. Use the `useCallback()` hook to wrap and memoize these functions as `createPortal()`. - Use the `useEffect()` hook to call `createPortal()` and update the state variable any time `el`'s value changes. - Finally, return the `render()` function of the state variable.