airair
All questions

Calling a hook conditionally

NewQuizReactmedium~3 minrules of hooks, useState
function Profile({ user }: { user: User | null }) {
  if (!user) return <p>Sign in</p>;
  const [tab, setTab] = useState("posts");
  return <Tabs value={tab} onChange={setTab} />;
}

The component first renders with user = null, then re-renders with a real user. What happens on the second render?

Choose one answer