mithi / epic-react-exercises

Practical React exercises with detailed solutions.
https://epic-react-exercises.vercel.app
Apache License 2.0
159 stars 36 forks source link

Refactor `useNextEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect` #65

Open mithi opened 3 years ago

mithi commented 3 years ago

I'm calling this everywhere move is somewhere and call it from there so that I don't always copy paste this everywhere

const useNextEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect

in the following files: