Skip to content

lsanthosh08/react-react_native-runtimer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published