https://github.com/optum/react-hooks
https://github.com/optum/react-hooks
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/optum/react-hooks
- Owner: Optum
- License: apache-2.0
- Created: 2023-04-19T15:18:52.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-05-12T20:02:59.000Z (about 1 year ago)
- Last Synced: 2025-05-12T20:50:01.635Z (about 1 year ago)
- Language: TypeScript
- Size: 59.8 MB
- Stars: 4
- Watchers: 3
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]
[![LinkedIn][linkedin-shield]][linkedin-url]
Table of Contents
## About The Project
This library contains various reusable hooks built and currently being used throughout [Optum](https://optum.com). They were created with the goal of simplifying otherwise complex react procedures and concepts, such as state management of asynchronous data, accessibility, etc. Please feel free to explore this repository and use, contribute, and add to these hooks!
## Getting Started
Run one of the following commands to add React Hooks to your project:
**npm**
```shell
npm install @optum/react-hooks
```
or
**yarn**
```shell
yarn add @optum/react-hooks
```
### Prerequisites
#### Peer dependencies
Please note that [react](www.npmjs.com/package/react) and [react-dom](www.npmjs.com/package/react-dom) are peer dependencies, and should be installed _before_ installing React Hooks
```json
"peerDependencies": {
"react": "^17.0.0 || ^18.0.0",
},
```
#### Package Manager
Have desired javascript package mananger installed on your machine:
* [yarn](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable)
* preferred but not required
or
* [npm](https://www.npmjs.com/package/npm)
_**Optional**_
* [yalc](https://github.com/wclr/yalc)
* used for testing package locally
### Testing Changes Locally
If you are in the process of making changes to this repo and wish to test them, or simply wish to playground with our hooks:
1. Have a working react project
2. Have [yalc](https://github.com/wclr/yalc) installed globally
```sh
yarn global add yalc
```
3. Inside `react-hooks` directory, publish package to yalc store
```sh
yalc publish
```
4. Inside of directory of your project, add package
```sh
yalc add react-hooks
```
5. As you make changes inside of `react-hooks`, continue publishing to store, as explained in step 3.
6. Update yalc store inside of project directory after each new publish (this may require stopping running instances of project)
```sh
yalc update
```
7. Once finished, remove yalc package from project directory
```sh
yalc remove react-hooks
```
or
```sh
yalc remove --all
```
(if you wish to remove other yalc packages)
## Usage
Please refer to directories inside of `/hooks` for usages of individual hooks.
## Roadmap
See the [open issues](https://github.com/optum/react-hooks/issues) for a full list of proposed features (and known issues).
## Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!
1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request
## License
Distributed under the Apache 2.0 License. See `LICENSE.txt` for more information.
## Maintainers
- Niels Peschel
- GitHub: [NielsJPeschel](https://github.com/NielsJPeschel)
- Email: peschel.niels@gmail.com
- Nicholas Thurow
- GitHub: [nthurow](https://github.com/nthurow)
[contributors-shield]: https://img.shields.io/github/contributors/optum/react-hooks.svg?style=for-the-badge
[contributors-url]: https://github.com/optum/react-hooks/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/optum/react-hooks.svg?style=for-the-badge
[forks-url]: https://github.com/optum/react-hooks/network/members
[stars-shield]: https://img.shields.io/github/stars/optum/react-hooks.svg?style=for-the-badge
[stars-url]: https://github.com/optum/react-hooks/stargazers
[issues-shield]: https://img.shields.io/github/issues/optum/react-hooks.svg?style=for-the-badge
[issues-url]: https://github.com/optum/react-hooks/issues
[license-shield]: https://img.shields.io/github/license/optum/react-hooks.svg?style=for-the-badge
[license-url]: https://github.com/optum/react-hooks/blob/master/LICENSE.txt
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555
[linkedin-url]: https://linkedin.com/in/niels-peschel
[product-screenshot]: images/screenshot.png