Skip to content

Portals break context #2

@acdlite

Description

@acdlite

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions