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

Export ApolloContext to use in classes or hooks #2961

Merged
merged 5 commits into from
Apr 21, 2019

Conversation

MrLoh
Copy link
Contributor

@MrLoh MrLoh commented Apr 12, 2019

#2540 didn't include any way to access the apollo context and #2872 only made it into the v3 branch. By simply exposing the ApolloContext it can be used with MyClassComponent.contextType = ApolloContext or with useContext(ApolloContext) without having to change any react peer dependencies.

@FezVrasta
Copy link

This would be great to reduce the amount of code needed to run react-apollo-hooks, that way it will be easier to migrate to the official Hooks implementation once ready.

@MrLoh
Copy link
Contributor Author

MrLoh commented Apr 16, 2019

@hwillson any chance that this could be merged?

Copy link
Member

@hwillson hwillson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks @MrLoh!

@FezVrasta
Copy link

When can we expect this to be released?

@hwillson
Copy link
Member

@FezVrasta react-apollo 2.5.5 was just released with this change.

@FezVrasta
Copy link

Great thanks!

@danielkcz
Copy link
Contributor

Thanks @MrLoh. Finally, we can drop a double provider (react-apollo-hooks)!

@FezVrasta
Copy link

@FredyC I started a discussion here trojanowski/react-apollo-hooks#131

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.

4 participants