Skip to content

Fix(react-query): ensure mutationKey is always array #7281

@jonathanstanley

Description

@jonathanstanley

Describe the bug
React Query is requiring queryKeys and mutationKeys to always be an array. see:
TanStack/query#2919

To Reproduce
Use with React Query v4 (currently alpha) will throw type errors.

Expected behavior
Use an array for the keys instead of a string. i.e. ['mystring'] instead of 'mystring'

Environment:
any

Additional context
v4 is currently in pre-release and will become more pressing once released. This is a backwards-compatible upgrade... arrays have always been an acceptable key.

Metadata

Metadata

Assignees

No one assigned

    Labels

    stage/5-alpha-release-testingThe pull request is merged, an alpha release is available, to be tested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions