diff --git a/reactjs-interview-questions/use-effect-hook-polyfill/src/hooks/use-custom-effect.js b/reactjs-interview-questions/use-effect-hook-polyfill/src/hooks/use-custom-effect.js index 01b1555..907452e 100644 --- a/reactjs-interview-questions/use-effect-hook-polyfill/src/hooks/use-custom-effect.js +++ b/reactjs-interview-questions/use-effect-hook-polyfill/src/hooks/use-custom-effect.js @@ -2,7 +2,7 @@ import {useRef} from "react"; const useCustomEffect = (effect, deps) => { const isFirstRender = useRef(true); - const prevDeps = useRef([]); + const prevDeps = useRef(deps ?? []); // First Render if (isFirstRender.current) {