Sobes.tech
Junior — Senior

Custom hook that determines the first render of the component

livecode

Task condition

Create a custom hook useFirstRender that returns true only during the first render of the component, and false on all subsequent renders.

export default function App (props) { 
  const isFirstRender = useFirstRender();
  if(isFirstRender) return null;
  
  return props.children;
}