1.0.0-beta.3 • Published 3 years ago

@rogal/async-render v1.0.0-beta.3

Weekly downloads
14
License
MIT
Repository
-
Last release
3 years ago

async-render NPM Version NPM Downloads Actions Status Actions Status Coverage Status

async-render gives you a component to show spinners after a timeout until suspense is ready

Install

npm install @rogal/async-render --save

Getting Started

In this example the h1 element will be shown after 2s

import React from 'react'
import {
  AsyncRender
} from '@rogal/async-render';

const App = () => {
  return (
    <AsyncRender loading>
      <h1>hello</h1>
    </TranslateProvider>
  )
}

How to increase the timeout

The timeout by default is 2000, so you can increase giving the prop timeout

import React from 'react'
import {
  AsyncRender
} from '@rogal/async-render';

const App = () => {
  return (
    <AsyncRender loading timeout={4000}>
      <h1>hello</h1>
    </TranslateProvider>
  )
}

Props

NameTypeDefault
loadingBooleannone
childrenReact.Nodenone
timeoutnumber2000

How to contribute

You can install and have an enviroment ready for use with Storybook

  npm i
  npm start

License

MIT

1.0.0-beta.3

3 years ago

1.0.0-beta.2

4 years ago

1.0.0-beta.0

4 years ago