React Hooks Question:
If a child component re-renders because its parent re-renders, and inside the child:
a function is memoized using useCallback with an empty dependency array
that function is called inside a useEffect with an empty dependency array
Will the function be called again or recreated on re-render?
Also, if an object is defined directly inside the component body, will that object be recreated on every re-render?
👉 Code snippet is shared in the comment box.
#reactjsinterview #sde2 #fortnite #fortnitegameplay #realInterview #reactjsinterviewquestions #reacttutorial #ezsnippet