# use-suspense-today

> Use React Suspense today, with any data fetching library

Latest version **1.0.1** (published 2019-09-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install use-suspense-today
pnpm add use-suspense-today
yarn add use-suspense-today
bun add use-suspense-today
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2019-09-22 |
| First published | 2019-09-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=8 |
| Dependencies | 2 |
| Unpacked size | 534.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 29 |
| Author | Hermanya |
| Maintainers | hermanya |
| Keywords | react, suspense, loading, apollo, react-hooks |

## Links

- npm: https://www.npmjs.com/package/use-suspense-today
- Repository: https://github.com/Hermanya/use-suspense-today
- Homepage: https://github.com/Hermanya/use-suspense-today#readme
- Issues: https://github.com/Hermanya/use-suspense-today/issues
- npm.io page: https://npm.io/package/use-suspense-today

## Dependencies (2)

- [react-test-renderer](https://npm.io/package/react-test-renderer.md) ^16.9.0
- [@types/react-test-renderer](https://npm.io/package/@types/react-test-renderer.md) ^16.9.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2019-09-22
- 1.0.0 — 2019-09-22

## README

# use-suspense-today

> Use React Suspense today, with any data fetching library

[![NPM](https://img.shields.io/npm/v/use-suspense-today.svg)](https://www.npmjs.com/package/use-suspense-today) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](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 <section>{data}</section>;
};

const Parent = () => {
  return (
    <React.Suspense fallback={<div>Loading...</div>}>
      <Child />
    </React.Suspense>
  );
};
```

Check out unit tests for a better example.

## License

MIT © [Hermanya](https://github.com/Hermanya)

---

This hook is created using [create-react-hook](https://github.com/hermanya/create-react-hook).

---
_Source: https://npm.io/package/use-suspense-today · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
