You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to use React Router's <Link /> component inside a <MagicMove /> container, it breaks.
Warning: Required context `isActive` was not specified in `Link`.
I believe this is because the cloned links are in a totally separate different render tree, so they cannot access context provided by the router. One of the downsides of portals, I suppose.
I can't think of a good solution. The only one that comes to mind is to provide an interface to dynamically create the MagicMove class, so that you can insert a static contextTypes property as needed. But that's gross, right?
The text was updated successfully, but these errors were encountered:
Maybe a make MagicMove a wrapper component that internally creates a component on the fly. It either returns the default MagicMove component, or if a context prop is provided, it creates a new component with React.createClass() with the given context and returns that.
acdlite
changed the title
Portals breaks context
Portals break context
Feb 6, 2015
@acdlite yes..seems than child nodes (nested elements) doesnt receive the context, I'm facing the same problem right now because I'm using baobab and the tree is passed using the context
I was checking the code of react-magic-move but some parts are a bit difficult to understand for me, basically because it works using react in a very special way
this problem seems will be solved with react 14 but if you can solve this lib before that please let me know.thanks!.
When I try to use React Router's
<Link />
component inside a<MagicMove />
container, it breaks.I believe this is because the cloned links are in a totally separate different render tree, so they cannot access context provided by the router. One of the downsides of portals, I suppose.
I can't think of a good solution. The only one that comes to mind is to provide an interface to dynamically create the MagicMove class, so that you can insert a static
contextTypes
property as needed. But that's gross, right?The text was updated successfully, but these errors were encountered: