react icon indicating copy to clipboard operation
react copied to clipboard

SUGGESTION Return a promise

Open timurtu opened this issue 9 years ago • 3 comments

It would be nice if you could return a promise that resolves to a component in the render function or as the return value of a stateless functional component. It might be complex because components need to rerender and promises get cached when they resolve

timurtu avatar May 05 '17 04:05 timurtu

"Return Promise from render" sounds similar to https://github.com/facebook/react/issues/1739 so let's keep the discussion there. We did a prototype of a slightly different approach in https://github.com/facebook/react/pull/8595, and we might revisit in the future.

gaearon avatar May 05 '17 11:05 gaearon

Cool true but doesn't using componentWillMount mean it has to be stateful?

timurtu avatar May 05 '17 12:05 timurtu

The issue is a bit more general (further discussion is not just about componentWillMount).

gaearon avatar May 05 '17 16:05 gaearon