|
76 | 76 | <!-- ABOUT THE PROJECT -->
|
77 | 77 | ## About The Project
|
78 | 78 |
|
79 |
| -This repository 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! |
| 79 | +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! |
80 | 80 |
|
81 | 81 | <p align="right">(<a href="#top">back to top</a>)</p>
|
82 | 82 |
|
83 | 83 | <!-- GETTING STARTED -->
|
84 | 84 | ## Getting Started
|
85 |
| -Currently, `react-hooks` is not published in `npm`. Please see [Test Changes Locally](#test-locally) for a way to run our hooks locally |
| 85 | +Run one of the following commands to add React Hooks to your project: |
| 86 | + |
| 87 | +**npm** |
| 88 | +```shell |
| 89 | +npm install @optum/react-hooks |
| 90 | +``` |
| 91 | + |
| 92 | +or |
| 93 | + |
| 94 | + |
| 95 | +**yarn** |
| 96 | +```shell |
| 97 | +yarn add @optum/react-hooks |
| 98 | +``` |
| 99 | + |
86 | 100 |
|
87 | 101 | ### Prerequisites
|
| 102 | +#### Peer dependencies |
| 103 | +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 |
| 104 | + |
| 105 | +```json |
| 106 | +"peerDependencies": { |
| 107 | + "react": "^17.0.0 || ^18.0.0", |
| 108 | + "react-dom": "^17.0.0 || ^18.0.0" |
| 109 | +}, |
| 110 | +``` |
| 111 | +#### Package Manager |
88 | 112 | Have desired javascript package mananger installed on your machine:
|
89 | 113 |
|
90 | 114 | * [yarn](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable)
|
|
94 | 118 | * [npm](https://www.npmjs.com/package/npm)
|
95 | 119 |
|
96 | 120 |
|
97 |
| -**Optional** |
| 121 | +_**Optional**_ |
98 | 122 | * [yalc](https://github.com/wclr/yalc)
|
99 | 123 | * used for testing package locally
|
100 | 124 |
|
101 |
| - |
102 |
| -### Installation |
103 |
| -Currently, this package is not published and can therefore not be installed by conventional means (_yarn_ or _npm_). Please see next section if you still wish to utilize this pacakge locally |
104 |
| -<!-- 1. Clone the repo |
105 |
| - ```sh |
106 |
| - git clone https://github.com/optum/react-hooks.git |
107 |
| - ``` |
108 |
| -2. Install NPM packages |
109 |
| - ```sh |
110 |
| - yarn install |
111 |
| - ``` --> |
112 |
| - |
113 |
| -<p align="right">(<a href="#top">back to top</a>)</p> |
114 |
| - |
115 | 125 | <div id='test-locally'>
|
| 126 | + |
116 | 127 | ### Testing Changes Locally
|
117 | 128 | 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:
|
118 | 129 |
|
|
0 commit comments