reactjs/react.dev

Mention that `Component.render` could return iterator

Open

#286 ouverte le 14 nov. 2017

Voir sur GitHub
 (5 commentaires) (0 réactions) (0 assignés)JavaScript (7 898 forks)github user discovery
difficulty: mediumgood first issuetype: documentation

Métriques du dépôt

Stars
 (11 763 stars)
Métriques de merge PR
 (Merge moyen 37j 15h) (21 PRs mergées en 30 j)

Description

According to the discussion here https://github.com/facebook/react/issues/11502 it is legal to return iterators from Component.render. But it is not mentioned in the document.

Moreover -- it would work only in production mode, not in development. It should me mentioned that to make it work in both environments -- you should use iterable, rather than iterator (see this Seq approach from the Reach issue).

I suggest to place it around https://reactjs.org/docs/react-component.html#fragments

Guide contributeur