reactjs/react.dev

Mention that `Component.render` could return iterator

Open

#286 geöffnet am 14. Nov. 2017

Auf GitHub ansehen
 (5 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (7.898 Forks)github user discovery
difficulty: mediumgood first issuetype: documentation

Repository-Metriken

Stars
 (11.763 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 37T 15h) (21 gemergte PRs in 30 T)

Beschreibung

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

Contributor Guide