@trillionthoughts/react-react_native-runtimer
v1.0.5
Published
Package made with ts you can render (React or React native)jsx through render props.
Downloads
2
Maintainers
Readme
React / React Native - Runtimer
Package made with ts you can render (React or React native)jsx through render props.
Installation
Use the package manager npm or yarn to install.
npm i @trillionthoughts/react-react_native-runtimer
or
yarn add @trillionthoughts/react-react_native-runtimer
Usage
In React
...
import Timer from "@trillionthoughts/react-react_native-runtimer"
{...
<Timer render={(timer) => <p>{timer}<p> }/>;
...};
In React Native
...
import Timer from "@trillionthoughts/react-react_native-runtimer"
{...
<Timer render={(timer) => <Text>{timer}<Text> }/>;
...};
Props
| Props | usage | default | | ---------- | ---------------------------- | ---------- | | iniValue | in sec or ms | 0 | | inputType | "s" or "ms" | "s" | | formatTime | "hh:mm:ss" or "ss" | "hh:mm:ss" | | render | (timer:string)=> jsx.element | <></> | | autoStart | boolean | false | | start | ref.current.start() | - | | stop | ref.current.stop() | - | | toggle | ref.current.toggle() | - | | reset | ref.current.reset() | - |
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.Github
Licence