Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

This is NPM package with a component for React that will help you display the loader at use react-promise-tracker

License

NotificationsYou must be signed in to change notification settings

awibox/react-promise-loader

react-promise-loader

VersionBuildCoverageMinified sizeDownloadsPRs WelcomeTested with jest

Table of contents

Installation

You need to install promise loader and promise tracker packages:

npm install react-promise-loader react-promise-tracker

You can use yarn:

yarn add react-promise-loader react-promise-tracker

Getting started

Wrap promises that you would like to track as in the following example:

+ import { trackPromise} from 'react-promise-tracker';//...+ trackPromise(    fetchUsers(); // You function that returns a promise+ );

Then you need to add the Loader component and send data from the react-promise-tracker:

+ import { usePromiseTracker } from 'react-promise-tracker';+ import Loader from 'react-promise-loader';const App = () => (  <div className="app">    ...+     <Loader promiseTracker={usePromiseTracker} color={'#3d5e61'} background={'rgba(255,255,255,.5)'} />  </div>);export default App;

The settings of the component

ParameterTypeDescriptionDefault
backgroundstringSets the color for the background in any format that supports cssrgba(255,255,255,.5)
colorstringSets the color of the spinner#000
promiseTrackerbooleanYou need to setusePromiseTracker function from thereact-promise-trackerfalse
loadingbooleanIf you need to run the loader without tracking promises you should settruefalse
zIndexnumberYou can change the z-index to distribute the layers correctly999

Contributing

Please read through ourCONTRIBUTING.md.

About

This is NPM package with a component for React that will help you display the loader at use react-promise-tracker

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors5


[8]ページ先頭

©2009-2025 Movatter.jp