0.1.2 • Published 9 months ago

use-current-date v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

useCurrentDate

A simple utility hook for React that stores and provides the current date as state. When the date changes, the component renders.

Installation

You can install the package using either npm or yarn.

npm

npm install use-current-date

yarn

yarn add use-current-date

Usage

Here's an example of how you can use the useCurrentDate hook in your React component:

import React from 'react';
import useCurrentDate from 'use-current-date';

const MyComponent = () => {
  const currentDate = useCurrentDate();

  return (
    <div>
      <h1>Current Date</h1>
      <p>{currentDate.toDateString()}</p>
    </div>
  );
};

export default MyComponent;

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvement, feel free to open an issue or submit a pull request on the GitHub repository.

Please make sure to follow the Contributor's Guide when submitting pull requests.

License

This project is licensed under the MIT License.

Feel free to modify the content to suit your specific package or add any additional sections you deem necessary.

0.1.2

9 months ago

0.1.1

10 months ago

0.1.0

10 months ago