Skip to content

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

@scientist1642

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"]],
  });
}

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