yahoo / fluxible

A pluggable container for universal flux applications.

Home Page:http://fluxible.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

connectToStores does not account for react transition group methods

pizzarob opened this issue · comments

When you have a child of React Transition Group that is wrapped in the connectToStores higher order component the Transition Group lifecycle methods (https://facebook.github.io/react/docs/animation.html#low-level-api-reacttransitiongroup) will be stripped from the component. The fix for this is to account for the Transition Group lifecycle methods in connectToStores.

Pull request #499

I'm not sure I like the idea of hoisting prototype methods up to the HoC, but I understand the problem you're facing. Let me think about solutions.

Great. I'm looking forward to see what you come up with.

So it looks like react-redux has a similar issue that was opened that we'll probably take the same stance on: reduxjs/react-redux#303. Since the API is specific to an add-on, and there is no limit to how many addons that we could possibly have to support, I don't think we can start supporting hoisting APIs outside of the core of React.

You could hoist them yourself by adding to the prototype after calling the HoC or create a custom HoC that supports the specific APIs that your component uses.