New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: add getWrappedInstance to withApollo #331

Closed
SachaG opened this Issue Nov 17, 2016 · 5 comments

Comments

Projects
None yet
4 participants
@SachaG
Copy link

SachaG commented Nov 17, 2016

Unless I'm mistaken I think the withApollo HoC doesn't have a getWrappedInstance method, unlike the graphql wrapper. Maybe one could be added?

@SachaG SachaG changed the title Add getWrappedInstance to withApollo Suggestion: add getWrappedInstance to withApollo Nov 17, 2016

@stubailo

This comment has been minimized.

Copy link
Member

stubailo commented Nov 18, 2016

Good idea - send a PR?

@jbaxleyiii

This comment has been minimized.

Copy link
Member

jbaxleyiii commented Dec 21, 2016

@SachaG I'm all for this, it makes sense to have with both. I'm curious, what do you have a need to get the wrapped instance for? I've never had the need to do and have wondered 👍

@SachaG

This comment has been minimized.

Copy link
Author

SachaG commented Dec 21, 2016

@jbaxleyiii well let's say you have an ES6 class MyComponent with a submitForm event handler as one of its methods, and you then wrap it with withApollo. If do const Foo extends MyComponent to declare a new component, Foo won't have access to the submitForm method. So you'd want to be able to do const Foo extends MyComponent.getWrappedInstance() to access the original component before it's wrapped.

@helfer

This comment has been minimized.

Copy link
Member

helfer commented Jan 10, 2017

@SachaG any progress on this? 🙂

@SachaG

This comment has been minimized.

Copy link
Author

SachaG commented Jan 10, 2017

Oh sorry, I got sidetracked. Also @xavcz mentioned he might want to work on this.

Personally what held me up is that I haven't actually worked on NPM packages before (I'm still a Meteor guy at heart ;), so I don't have the workflow set up. Would you have any pointers on that by any chance?

@xavxyz xavxyz referenced this issue Jan 11, 2017

Merged

withRef option for withApollo HoC #410

6 of 6 tasks complete

@SachaG SachaG closed this Jan 12, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment