An open API service indexing awesome lists of open source software.

https://github.com/optum/react-hooks


https://github.com/optum/react-hooks

Last synced: 3 months ago
JSON representation

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]





Logo

react-hooks


A reusable set of React hooks.


Explore the docs »




Report Bug
·
Request Feature


Table of Contents



  1. About The Project



  2. Getting Started


  3. Usage

  4. Roadmap

  5. Contributing

  6. License

  7. Contact

  8. Acknowledgments

## 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!

(back to top)

## 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)

(back to top)

## Usage
Please refer to directories inside of `/hooks` for usages of individual hooks.

(back to top)

## Roadmap

See the [open issues](https://github.com/optum/react-hooks/issues) for a full list of proposed features (and known issues).

(back to top)

## 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

(back to top)

## License

Distributed under the Apache 2.0 License. See `LICENSE.txt` for more information.

(back to top)

## Maintainers

- Niels Peschel
- GitHub: [NielsJPeschel](https://github.com/NielsJPeschel)
- Email: peschel.niels@gmail.com
- Nicholas Thurow
- GitHub: [nthurow](https://github.com/nthurow)

(back to top)

[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