reactjs/react.dev

Mention that `Component.render` could return iterator

Open

#286 opened on Nov 14, 2017

View on GitHub
 (5 comments) (0 reactions) (0 assignees)JavaScript (7,898 forks)github user discovery
difficulty: mediumgood first issuetype: documentation

Repository metrics

Stars
 (11,763 stars)
PR merge metrics
 (Avg merge 37d 15h) (21 merged PRs in 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

Contributor guide