# @helpscout/react-utils

> Handy utilities for React

Latest version **2.4.1** (published 2022-04-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install @helpscout/react-utils
pnpm add @helpscout/react-utils
yarn add @helpscout/react-utils
bun add @helpscout/react-utils
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.4.1 |
| Published | 2022-04-04 |
| First published | 2018-07-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 69.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Jon Quach |
| Maintainers | knicklabs, itsjonq, charca, helpscout, plbabin |

## Links

- npm: https://www.npmjs.com/package/@helpscout/react-utils
- Repository: https://github.com/helpscout/react-utils
- Homepage: https://github.com/helpscout/react-utils#readme
- Issues: https://github.com/helpscout/react-utils/issues
- npm.io page: https://npm.io/package/@helpscout/react-utils

## Dependencies (4)

- [dash-get](https://npm.io/package/dash-get.md) 1.0.2
- [fsevents](https://npm.io/package/fsevents.md) 2.0.1
- [create-react-context](https://npm.io/package/create-react-context.md) 0.2.3
- [hoist-non-react-statics](https://npm.io/package/hoist-non-react-statics.md) 3.2.1

## Recent versions

- 2.4.1 (latest) — 2022-04-04
- 2.4.0 — 2020-06-26
- 2.3.0 — 2019-03-11
- 2.2.0 — 2019-03-05
- 2.1.1 — 2019-02-28
- 2.1.0 — 2019-02-28
- 2.0.1 — 2019-01-28
- 2.0.0 — 2019-01-11
- 1.0.6 — 2019-01-09
- 1.0.5 — 2019-01-08
- 1.0.4 — 2018-11-22
- 1.0.4-3 — 2018-11-22
- 1.0.4-2 — 2018-11-22
- 1.0.4-1 — 2018-11-22
- 1.0.4-0 — 2018-11-22
- … 11 more at https://npm.io/package/@helpscout/react-utils/versions

## README

# 🌀 React Utils

[![npm version](https://badge.fury.io/js/%40helpscout%2Freact-utils.svg)](https://badge.fury.io/js/%40helpscout%2Freact-utils) [![Build Status](https://travis-ci.org/helpscout/react-utils.svg?branch=master)](https://travis-ci.org/helpscout/react-utils) [![Coverage Status](https://coveralls.io/repos/github/helpscout/react-utils/badge.svg?branch=master)](https://coveralls.io/github/helpscout/react-utils?branch=master) [![npm version](https://badge.fury.io/js/%40helpscout%2Fblue.svg)](https://badge.fury.io/js/%40helpscout%2Fblue) ![node](https://img.shields.io/badge/node-8.11.3-blue.svg) ![npm](https://img.shields.io/badge/npm-6.4.1-blue.svg)

> A collection of handy utilities for React.

## Table of contents

- [🔧 Installation](./#-installation)
- [🕹 Usage](./#🕹-usage)

## 🔧 Installation

```text
npm install --save @helpscout/react-utils
```

This library has a `peerDependencies` listing of `react` \(version `15` or `16`\).

## 🕹 Usage

This library comes with a handful of useful functions. Below is an example of how you can use the `getDocumentFromComponent` function to retrieve the actual `document` the component is mounted to \(rather than assuming `window.document`\).

```jsx
import React from 'react'
import getDocumentFromComponent from '@helpscout/react-utils/dist/getDocumentFromComponent'

class Napoleon extends React.Component {
  ...
  componentDidMount () {
    this.doc = getDocumentFromComponent(this)
    // document
  }
  ...
}
```

Check out [**the documentation**](docs/) for more details.

---
_Source: https://npm.io/package/@helpscout/react-utils · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
