Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Update docs on data.subscribeToMore for React 16. #2181

Closed
1 task done
brainkim opened this issue Jul 12, 2018 · 0 comments
Closed
1 task done

Update docs on data.subscribeToMore for React 16. #2181

brainkim opened this issue Jul 12, 2018 · 0 comments
Labels
docs Focuses on documentation changes

Comments

@brainkim
Copy link

Trying to use data.subscribeToMore but the docs use the now deprecated componentWillReceiveProps.

A common practice is to wrap the subscribeToMore call within componentWillReceiveProps and perform the subscription after the original query has completed.

https://www.apollographql.com/docs/react/api/react-apollo.html#graphql-query-data-subscribeToMore

Might be time to update docs to use static getDerivedStateFromProps, but this would involve storing the subscription returned from subscribeToMore in React state b/c we no longer have access to the component instance.

I’m curious to know what the standard way to use subscribeToMore is in React 16.

  • docs
@ghost ghost added the docs Focuses on documentation changes label Jul 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
docs Focuses on documentation changes
Projects
None yet
Development

No branches or pull requests

1 participant