Hacker News new | ask | show | jobs
by egeozcan 3034 days ago
As far as I understand:

If you throw a promise (throw as in throwing an error) from the render function, React will retry when it resolves. `createFetcher` is a cache layer so that you don't DOS your own server on re-renders. Maybe though encouraging people use a ServiceWorker for that would have made more sense (edit: it also throws the promise for you when you access the cached value. so, yeah, it is very well-thought indeed).

Apart from that, this seems to be very simple to use, well-thought and useful.

1 comments

This sounds about right. I would note the atomicity of the actual screen update. We don't flush the changes until the whole tree resolves. Another thing to note is that we try to render as much of the tree as we can (e.g. if a sibling asks for a retry, we still try to render other siblings so we can collect as many requests as possible).