Quantcast
Channel: ReScript Forum - Latest posts
Viewing all articles
Browse latest Browse all 1787

Rendering Recursive React Components

$
0
0

You can certainly use recursive components in react. However:

  1. the blog post relies on actually rendering the components via JSX, which means react is actually cutting new components. By calling make directly, we bypass that.
  2. The playground example is fine, because each call to the component consistently renders at the same depth + width, so the same number of hooks gets called per render. If the number of children actually relies on the state, things get dicey when that state changes.

Viewing all articles
Browse latest Browse all 1787

Trending Articles