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

Refactor to make the project compatible with the new context API. #1661

Conversation

excitement-engineer
Copy link
Contributor

@excitement-engineer excitement-engineer commented Feb 10, 2018

This pull request aims to update react-apollo with the new context API being introduced in react@16.3.

I introduced create-react-context as a polyfill for people using older versions of react. We first check if the createContext is available on the React object and if not then we fallback to the polyfill.

API that has been converted:

  • ApolloProvider
  • ApolloConsumer
  • Query
  • graphql HOC
  • QueryRecyclerProvider
  • Mutation
  • Subscription

@excitement-engineer excitement-engineer changed the title Initial refactor to make the project compatible with the new context API. Refactor to make the project compatible with the new context API. Feb 10, 2018
@jaydenseric
Copy link
Contributor

Are you sure SSR (getDataFromTree) is working when using the Consumer component from the new React context API? I'm having issues trying to walk into it with react-tree-walker, which has fairly similar logic.

@jbaxleyiii
Copy link
Contributor

@excitement-engineer this is done (including SSR @jaydenseric ) on #1742

@jbaxleyiii jbaxleyiii closed this Mar 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants