Skip to content

weekrise/use-today

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Use Today

A React hook for accessing the current date. When the date changes, the hook's value will update as well.

Install

# yarn
yarn add use-today

# npm
npm install --save use-today

Usage

import useToday from 'use-today';

let App = () => {
  let today = useToday();

  return (
    <div>
      <h1>{today.toISOString()}</h1>
    </div>
  )
}

License

MIT © Tobias Herber