
React will support async loading within render functions via thrown Promises - btown
https://twitter.com/acdlite/status/969171217356746752
======
btown
Dan Abramov just gave a much-hyped talk on this at JSConf Iceland;
unfortunately, the livestream of his talk is no longer available as 4 hours
have elapsed, but here's a screenshot I was able to capture:

[https://www.dropbox.com/s/wybqgtftuyqipk8/Screenshot%202018-...](https://www.dropbox.com/s/wybqgtftuyqipk8/Screenshot%202018-03-01%2009.41.11.png?dl=0)

And, digging into the source code released in this companion tweet,
imageFetcher.read() indeed throws a Promise that is apparently caught by
React's new error handling infrastructure and pauses rendering for the
subtree.
[https://github.com/facebook/react/blob/master/packages/simpl...](https://github.com/facebook/react/blob/master/packages/simple-
cache-provider/src/SimpleCacheProvider.js#L187)

The talk indicated that there will be tons of support for showing spinners,
allowing interactivity with the rest of the interface, etc. while this loading
is ongoing.

Abramov, Clark, and other React core team members hyped this as "ushering in a
new era of innovation" and productivity, and while it's too soon to tell
without having access to the full presentation, what we know so far shows a
lot of Promise!

