-
Notifications
You must be signed in to change notification settings - Fork 49.9k
Closed
Description
What is the current behavior?
When you provide a list of React components -- its works. When you provide an iterator of React components -- it does not work.
This works:
const App = props => (
<ul>
{[...elements()]}
</ul>
);
const elements = function* () {
yield (<li>1</li>);
yield (<li>2</li>);
yield (<li>3</li>);
};
Doesn't work:
const App = props => (
<ul>
{elements()}
</ul>
);
const elements = function* () {
yield (<li>1</li>);
yield (<li>2</li>);
yield (<li>3</li>);
};
Unfortunately, I couldn't make it run on JSFiddle, maybe it has no support of iterators.
What is the expected behavior?
It should render exactly the same version as list-based one:
- 1
- 2
- 3
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
react-dom 16.0.0 and 15.x, browser-independent (I tried in Firefox 56).
ashnur and branko-d