Skip to content

why-did-you-render + React Query #279

Open

Description

@scientist1642

I wonder if someone has made it to work with react query, or if the library only works with certain type of hooks.

I have the following configuration, but updates to data doesn't cause it to log.
const { data, error } = useQuery... whenever data updates component will re-render, but I don't see anything in console. (useState updates are visible though)

export function enableWhyDidYouRender(react) {
  const ReactQuery = require("@tanstack/react-query");
  if (process.env.NODE_ENV !== "development") return;
  whyDidYouRender(react, {
    include: [/./],
    exclude: [],
    trackAllPureComponents: true,
    trackHooks: true,
    logOwnerReasons: true,
    logOnDifferentValues: true,
    collapseGroups: true,
    trackExtraHooks: [[ReactQuery, "useQuery"]],
  });
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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