mock-progress-react
v1.0.8
Published
hook for mocking progress
Downloads
110
Maintainers
Readme
mock-progress-react
Installation
To install the latest stable version:
npm install --save mock-progress-react
Basic usage:
import React from "react";
import { useMockProgress } from "mock-progress-react";
function App() {
const { start, finish, progress } = useMockProgress();
return (
<div className="App">
<p>Progress: {progress}</p>
<button onClick={start}> start progress</button>
<button onClick={finish}> complete progress</button>
</div>
);
}
Customize parameters:
import React from "react";
import { useMockProgress } from "mock-progress-react";
function App() {
const { progress, finish, start } = useMockProgress({timeInterval:1000, autoComplete:false});
return (
<div className="App">
<p>Progress: {progress}</p>
<button onClick={start}> start progress </button>
<button onClick={finish}> complete progress</button>
</div>
);
}