3 ms·
The new suspense API works by throwing Promises when the data isn't ready yet.
by jbaudanza 7y ago
The new suspense API works by throwing Promises when the data isn't ready yet.
- erikpukinskis 7y agoI’m not sure what you mean by “throwing promises”... You mean returning unresolved promises? Or returning rejected promises? Or just throwing an error?
- acemarke 7y agoLiterally, _throwing_ a Promise. React will catch promises thrown during rendering, and treat that as a request to "suspend" the component and come back to it later once the promise has resolved.