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

Suggestion: add getWrappedInstance to withApollo #331

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

Suggestion: add getWrappedInstance to withApollo #331

SachaG opened this issue Nov 17, 2016 · 5 comments

Comments

@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
Copy link
Contributor

Good idea - send a PR?

@jbaxleyiii
Copy link
Contributor

@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
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
Copy link
Contributor

helfer commented Jan 10, 2017

@SachaG any progress on this? 🙂

@SachaG
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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants