-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Maintain static functions #53
Comments
I wouldn't do that. It's only going to make things worse IMO: acdlite/flummox#173 (comment) |
Good call. I briefly looked into implementing it and the code disgusted me. |
I'm happy to reconsider it using https://github.com/mridgway/hoist-non-react-statics since we don't have to maintain it. Wanna make a PR? |
I was going to complain about the lack of docs for that library, but then I saw how utterly trivial the code is. Also, I can't remember the time I last used the word "hoist"; such a good word. Will add the PR to the todo list. |
I just, by chance, ran into a problem in my app where I need this functionality. Any chance of a release soon? |
Give me a few days, vacation :-) |
If in hurry you can do it in userland: MyComponentConnected = hoistNonReactStatics(connect(mapState)(MyComponent), MyComponent); It should be future compatible. |
You and your pink crocs enjoy your vacation. No hurry. 🐚 🌊 ☀️ For now I've just done |
Out in 3.1.0. |
Lol. I knew this is going to come back and bite me in the arse. |
Fix #596 See for reference: - reduxjs/react-redux#53 - reduxjs/react-redux#276
Could
connect()
check its wrapped component for static functions and add them to the returned component? For things likefetchData()
andonEnter()
. Seems like it would be pretty easy to go through the keys and check iftypeof WrappedComponent[key] === 'function'
.Just a thought.
The text was updated successfully, but these errors were encountered: