Skip to content
RED SAG Skills
medium10 pts · first answer countsreacthooks

A hook inside an if

Why does this break the rules of hooks?

function Profile({ user }) {
  if (!user) return <Login />
  const [tab, setTab] = useState("orders")
  // ...
}
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions