Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

uploadcare/client-suspense

сlient-suspense

A hacky way to start using React Suspense in production.

[![Build Status][build-img]][build-link] NPM version

In short, Suspense allows you to defer rendering part of your application tree until some condition is met (for example, some data are loaded).

While React Suspense is still in experimental mode and not suitable for production, this package provides an easy-to-use production-ready alternative.

Install

npm i @uploadcare/client-suspense
yarn add @uploadcare/client-suspense

Usage

import { Suspense, lazy } from '@uploadcare/client-suspense'

const LazyComponent = lazy(() => import('@uploadcare/react-widget'))

<Suspense fallback='loading...'>
  <LazyComponent />
</Suspense>

▶ Demo Sandbox

About

client only suspense for production

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 8