Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add getting started documentation #30

Merged
merged 2 commits into from
Apr 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 28 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,39 @@
<!-- ABOUT THE PROJECT -->
## About The Project

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

<p align="right">(<a href="#top">back to top</a>)</p>

<!-- GETTING STARTED -->
## Getting Started
Currently, `react-hooks` is not published in `npm`. Please see [Test Changes Locally](#test-locally) for a way to run our hooks locally
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",
"react-dom": "^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)
Expand All @@ -94,25 +118,12 @@ or
* [npm](https://www.npmjs.com/package/npm)


**Optional**
_**Optional**_
* [yalc](https://github.com/wclr/yalc)
* used for testing package locally


### Installation
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
<!-- 1. Clone the repo
```sh
git clone https://github.com/optum/react-hooks.git
```
2. Install NPM packages
```sh
yarn install
``` -->

<p align="right">(<a href="#top">back to top</a>)</p>

<div id='test-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:

Expand Down
Loading