Skip to content

Should useRevalidator be stable? #10706

@brophdawg11

Description

@brophdawg11

Discussed in #10702

Originally posted by charliematters July 14, 2023
I've got a hook which calls useRevalidator and ReactQuery's invalidateQueries to allow any component to refresh data.

I'm currently chasing down some unnecessary re-renders, and my useRevalidator hook is returning a new value each time.

The docs imply that it's a singleton under the hood, so I'd assumed that we could rely on useRevalidator not changing.

Have I misunderstood how this works?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions