There is a new cool feature in React — Suspense component. Currently it only officially supports components created using React.lazy function. But unofficially it well known that internally Suspense component is triggered by throwing a promise deeper in the render tree and there are some libraries that have already adopted this technique to bring a new cool developer experience, for example:
Also there is a core react package react-cache which uses it (unofficially of course).
Having all this in mind I'm kinda confused because there is no any mention in React Docs about throwing promises (in other words what triggers Suspense component) but at the same time there are lots of talks and libraries that use it. In twitter discussion dan abramov replied that the API will likely change. But still the situation is confusing.
So the question is: Is it safe to start using this technique in the production? If not, then how can I use libraries (even facebook based) that have already adopted it? Finally, if the API (throwing promises) is the subject to be changed in future, can I be assured that it's just a tiny change that I need to adopt in my own implementation?
Thanks folks!
Update
According to these issues (one, two) it seems like they still not sure about the future API. Most likely they will offer a public API (probably they mean react-cache or something more general) which is essentially just a wrapper around throwing Promise mechanism.