1.2.4 • Published 5 years ago

@uneksija/usetime v1.2.4

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

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>
}
1.2.4

5 years ago

1.2.3

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago