Skip to content

Allow context for useStore hook to be overridden #1367

@mpeyper

Description

@mpeyper

Do you want to request a feature or report a bug?

Feature.

What is the current behavior?

You cannot override the context to use for the useStore hook in the same way you can for Provider and connect, at least as far as I can tell.

What is the expected behavior?

I would like this feature as I need to override set the context to work around an issue with using lerna monorepo (the synlinked packages get their own copy of react-redux and consequently a different context instance).

I propose to add a context argument to useStore and pass it through to useReduxContext and use it if provided or fallback to the existing imported ReactReduxcContext.

I'm happy to make the change and I may even create a PR anyway.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions