Closed xesrevinu closed 8 years ago
I have stumbled upon a similar situation. Sometimes you'd just want to fetch things in children of Route components.
How about traversing components tree top-bottom in search of "hooked" components? Should be very straightforward using React.children helper.
Fix for wrapped component: https://github.com/coodoo/react-redux-isomorphic-example/blob/master/common/utils/fetchComponentData.js
Thanks
Few bytes from me. I already wrote this simple fix in another comment. So check it out here again :)
Sorry for reviving this thread. But if it has clue about problems with High Order Components (HoC) or just Wrappers over others components there is a fix. For example, if you have HOC which is wrapping your secured page component and checks authorization first before rendering a secured page, there is a problem that hooks on this wrapped components are not working. It can be solved with this lines of code
if (WrappedComponent['@@redial-hooks']) { AuthWrapper['@@redial-hooks'] = WrappedComponent['@@redial-hooks']; }
It will pull hooks up to the wrapper (HOC) so all of them will be triggered properly :)
routes.js
IndexContainer.js
FeedContainer.js
WelcomeContainer.js
This is normal
This is WrappedComponent
No redial_handlers should be have a problem I should be in another way? How to do it Thanks 😄