Skip to content
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

copies static methods to HOC #19

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

kellyrmilligan
Copy link

this copies static methods on the component class sent to connect to stores. this would be valuable for components that are at the top level, and in an SPA you may want to call fetch for server side rendering from a pre-defined method. this makes no assumptions on what the name of that method should be. you may also just want to call the fetch method before rendering, and being able to specify that in the component is nice.

@taion
Copy link
Member

taion commented Aug 8, 2016

Why not just use hoist-non-react-statics here?

@kellyrmilligan
Copy link
Author

Ummm..yes. Let me research that and modify the Pr.

@kellyrmilligan
Copy link
Author

reduxjs/react-redux#276

Sounds good to me. Let me modify this Pr with that instead.

@kellyrmilligan
Copy link
Author

@taion good idea. if approve would it be possible to publish this as a minor version as well? I see #15 would like this as well.

@taion
Copy link
Member

taion commented Aug 9, 2016

That's up to @goatslacker 😄

@kellyrmilligan
Copy link
Author

otherwise looks good though? I added a test as well :)

@@ -47,6 +47,7 @@
*/

import React from 'react'
import hoistNonReactStatic from 'hoist-non-react-statics'
Copy link
Member

Choose a reason for hiding this comment

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

"statics" probably

Copy link
Author

Choose a reason for hiding this comment

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

sure. was just copying that from the modules repo. update en route.

@kellyrmilligan
Copy link
Author

@taion updated. @goatslacker thoughts?

@kellyrmilligan
Copy link
Author

I guess for now I can use same technique on the component returned from connect until this is merged in right? Just would be nice to include it inline with the other statics

@kellyrmilligan
Copy link
Author

@goatslacker @taion should I just close this PR?

@kellyrmilligan
Copy link
Author

@goatslacker @taion status?

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

Successfully merging this pull request may close these issues.

None yet

2 participants