Socket
Socket
Sign inDemoInstall

@tanstack/react-query-devtools

Package Overview
Dependencies
3
Maintainers
0
Versions
344
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tanstack/react-query-devtools


Version published
Weekly downloads
1.5M
decreased by-3.34%
Maintainers
0
Install size
3.28 MB
Created
Weekly downloads
 

Package description

What is @tanstack/react-query-devtools?

@tanstack/react-query-devtools is a set of development tools for React Query, which helps in managing server-state in React applications. It provides a visual interface to inspect and debug queries, mutations, and cache data managed by React Query.

What are @tanstack/react-query-devtools's main functionalities?

Devtools Panel

The Devtools Panel provides a visual interface to inspect and debug queries and mutations. It can be toggled open or closed and provides detailed information about the state of your queries and mutations.

import { ReactQueryDevtools } from '@tanstack/react-query-devtools';

function App() {
  return (
    <>
      <YourAppComponents />
      <ReactQueryDevtools initialIsOpen={false} />
    </>
  );
}

Query Inspection

Query Inspection allows you to see the status, data, and error states of your queries. This is useful for debugging and ensuring that your queries are working as expected.

import { useQuery } from '@tanstack/react-query';

function MyComponent() {
  const { data, error, isLoading } = useQuery('myQueryKey', fetchMyData);

  return (
    <div>
      {isLoading ? 'Loading...' : error ? 'Error!' : data}
    </div>
  );
}

Mutation Inspection

Mutation Inspection allows you to see the status and results of your mutations. This helps in debugging and ensuring that your mutations are being executed correctly.

import { useMutation } from '@tanstack/react-query';

function MyComponent() {
  const mutation = useMutation(newData => fetch('/api/data', { method: 'POST', body: JSON.stringify(newData) }));

  return (
    <button onClick={() => mutation.mutate({ foo: 'bar' })}>
      Submit
    </button>
  );
}

Other packages similar to @tanstack/react-query-devtools

FAQs

Last updated on 25 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc