Hacker News new | ask | show | jobs
by vbezhenar 425 days ago
For some reason React prefers to return arrays. I never understood the reason.

  const [state, setState] = useState(initialState)
instead of

  const {state, setState} = useState(initialState)