AI

A common mistake is syncing state with useEffect. If a value can be calculated from existing props or state, compute it during render! Don't put it in state.

Your Task:

  • Refactor FullName to remove the fullName state and the useEffect
  • Calculate fullName directly in the component body
  • This removes an unnecessary render pass and simplifies the code
TypeScript Solution
Loading...

Submit your code to see test results