Skip to content

Optum/react-hooks

Repository files navigation

Contributors Forks Stargazers Issues MIT License LinkedIn


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

npm install @optum/react-hooks

or

yarn

yarn add @optum/react-hooks

Prerequisites

Peer dependencies

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"
},

Package Manager

Have desired javascript package mananger installed on your machine:

  • yarn
    • preferred but not required

or

Optional

  • 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 installed globally
yarn global add yalc
  1. Inside react-hooks directory, publish package to yalc store
yalc publish
  1. Inside of directory of your project, add package
yalc add react-hooks
  1. As you make changes inside of react-hooks, continue publishing to store, as explained in step 3.
  2. Update yalc store inside of project directory after each new publish (this may require stopping running instances of project)
yalc update
  1. Once finished, remove yalc package from project directory
yalc remove react-hooks

or

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

(back to top)

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •