reactjs/react.dev

Mention that `Component.render` could return iterator

Open

#286 建立於 2017年11月14日

在 GitHub 查看
 (5 留言) (0 反應) (0 負責人)JavaScript (7,898 fork)github user discovery
difficulty: mediumgood first issuetype: documentation

倉庫指標

Star
 (11,763 star)
PR 合併指標
 (平均合併 37天 15小時) (30 天內合併 21 個 PR)

描述

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

貢獻者指南