https://github.com/hermanya/use-suspense-today
⏳ Use React Suspense today, with any data fetching library
https://github.com/hermanya/use-suspense-today
Last synced: about 1 year ago
JSON representation
⏳ Use React Suspense today, with any data fetching library
- Host: GitHub
- URL: https://github.com/hermanya/use-suspense-today
- Owner: Hermanya
- Created: 2019-09-22T21:59:28.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T11:08:35.000Z (over 3 years ago)
- Last Synced: 2025-03-18T15:47:34.680Z (over 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 3.53 MB
- Stars: 29
- Watchers: 2
- Forks: 2
- Open Issues: 44
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# use-suspense-today
> Use React Suspense today, with any data fetching library
[](https://www.npmjs.com/package/use-suspense-today) [](https://standardjs.com)
## Install
```bash
npm install --save use-suspense-today
```
## Usage
```tsx
import * as React from 'react'
import { useSuspense } from 'use-suspense-today'
const Child = () => {
const { loading, data } = useApiThatIsNotSuspenseReady();
useSuspense(loading);
return {data};
};
const Parent = () => {
return (
Loading...}>
);
};
```
## License
MIT © [Hermanya](https://github.com/Hermanya)
---
This hook is created using [create-react-hook](https://github.com/hermanya/create-react-hook).