Add a note about suspense

This commit is contained in:
Dan Abramov
2018-03-24 18:23:13 +00:00
parent 6eae811789
commit a2139ded8a

View File

@@ -80,6 +80,8 @@ There is a common misconception that fetching in `componentWillMount` lets you a
> Note
>
> Some advanced use-cases (e.g. libraries like Relay) may want to experiment with eagerly prefetching async data. An example of how this can be done is available [here](https://gist.github.com/bvaughn/89700e525ff423a75ffb63b1b1e30a8f).
>
> In the longer term, the canonical way to fetch data in React components will likely be based on the “suspense” API [introduced at JSConf Iceland](/blog/2018/03/01/sneak-peek-beyond-react-16.html). Both simple data fetching solutions and libraries like Apollo and Relay will be able to use it under the hood. It is significantly less verbose than either of the above solutions, but at the moment it is not quite ready yet.
### Adding event listeners (or subscriptions)