@uneksija/usetime

1.2.4 • Public • Published

usetime

(P)react hook for realtime Date object

npm (scoped) GitHub

Installation

npm install @uneksija/usetime

Importing the hook

import useTime from `@uneksija/usetime` // for Preact
import useTime from `@uneksija/usetime/react` // for React

Example usage

function App() {
  const time = useTime() // returns a Date object
  return <span>{time.toLocaleString()}</span>
}

Readme

Keywords

Package Sidebar

Install

npm i @uneksija/usetime

Weekly Downloads

0

Version

1.2.4

License

MIT

Unpacked Size

2.82 kB

Total Files

6

Last publish

Collaborators

  • huijari
  • vihainen