Skip to content

Update <ApiProvider> to throw an error if it's used inside of another <Provider> #3852

@markerikson

Description

@markerikson

<ApiProvider> is only meant for apps that don't already have a Redux store being created. But, we've repeatedly seen people try to use something like <Provider store={store}><ApiProvider>, and then wonder why the app breaks.

We should add a debug check inside of <ApiProvider> that checks for the existence of const store = useStore() (or similar), and throw an error if it finds that above, to try to help users avoid that error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions