ibash 10 hours ago

Modern react developers forget that if statements exist. When react was class based it was trivial to do:

  render() {
    if (this.dontNeedToRender) {
      return null
    }
  }
Now, because hooks can't be skipped, react developers jump through many hoops to use an if statement during rendering.

1
prothy 7 hours ago

I might be missing your point, can you elaborate? If you want to write an if statement you just do it at the end of a component, after the hooks. It's a common pattern.