You can certainly use recursive components in react. However:
- 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. - 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.