reactjs/react.dev

Mention that `Component.render` could return iterator

Open

#286 aberto em 14 de nov. de 2017

Ver no GitHub
 (5 comments) (0 reactions) (0 assignees)JavaScript (7.898 forks)github user discovery
difficulty: mediumgood first issuetype: documentation

Métricas do repositório

Stars
 (11.763 stars)
Métricas de merge de PR
 (Mesclagem média 37d 15h) (21 fundiu PRs em 30d)

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

Guia do colaborador