New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-query-render-state

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-query-render-state

React Query Render State: This hook allows you to declaratively define components that will be rendered based on the data processing state.

latest
npmnpm
Version
1.0.16
Version published
Weekly downloads
3
-72.73%
Maintainers
1
Weekly downloads
 
Created
Source

React Query Render State

All Contributors NPM License NPM Downloads

React Query Render State: This hook allows you to declaratively define components that will be rendered based on the data processing state.

Installation

The easiest way to install react-query-render-state is with npm.

npm install react-query-render-state

Alternately, download the source.

git clone https://github.com/stegano/react-query-render-state.git

Quick Start

The useQueryRenderState hook enables a declarative approach to display components based on data processing status.

import { useQueryRenderState } from "react-query-render-state";

export const App = () => {
  const { render, ...queryResult } = useQueryRenderState({
    // ...`useQuery` options
    // You can also use `useInfiniteQueryRenderState` in the same way.
  });

  return render(
    () => <p>Idle</p>,                             // → renderIdle
    () => <p>Loading..</p>,                        // → renderLoading
    (data) => <div>Success({data})</div>,          // → renderSuccess
    (error) => <p>Error. :(, ({error.message})</p> // → renderError
  );
};

Demo: https://stackblitz.com/edit/stackblitz-starters-ccrgxa9c

Note: ✨ react-query-render-state is made based on @tanstack/react-query and react-render-state

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Yongwoo Jung
Yongwoo Jung

💻 🤔

This project follows the all-contributors specification. Contributions of any kind welcome!

Keywords

react

FAQs

Package last updated on 26 Apr 2025

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