Table of Contents
This library contains various reusable hooks built and currently being used throughout Optum. 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!
Run one of the following commands to add React Hooks to your project:
npm
npm install @optum/react-hooks
or
yarn
yarn add @optum/react-hooks
Please note that react and react-dom are peer dependencies, and should be installed before installing React Hooks
"peerDependencies": {
"react": "^17.0.0 || ^18.0.0",
"react-dom": "^17.0.0 || ^18.0.0"
},
Have desired javascript package mananger installed on your machine:
- yarn
- preferred but not required
or
Optional
- yalc
- used for testing package 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:
- Have a working react project
- Have yalc installed globally
yarn global add yalc
- Inside
react-hooks
directory, publish package to yalc store
yalc publish
- Inside of directory of your project, add package
yalc add react-hooks
- As you make changes inside of
react-hooks
, continue publishing to store, as explained in step 3. - Update yalc store inside of project directory after each new publish (this may require stopping running instances of project)
yalc update
- Once finished, remove yalc package from project directory
yalc remove react-hooks
or
yalc remove --all
(if you wish to remove other yalc packages)
Please refer to directories inside of /hooks
for usages of individual hooks.
See the open issues for a full list of proposed features (and known issues).
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!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the Apache 2.0 License. See LICENSE.txt
for more information.
- Niels Peschel
- GitHub: NielsJPeschel
- Email: peschel.niels@gmail.com
- Nicholas Thurow
- GitHub: nthurow