# react-mutant-hoc

> A utility to make React components easily consume Mutant observables

Latest version **1.1.0** (published 2017-12-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-mutant-hoc
pnpm add react-mutant-hoc
yarn add react-mutant-hoc
bun add react-mutant-hoc
```

## 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 | 1.1.0 |
| Published | 2017-12-09 |
| First published | 2017-12-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | staltz.com |
| Maintainers | staltz |

## Links

- npm: https://www.npmjs.com/package/react-mutant-hoc
- npm.io page: https://npm.io/package/react-mutant-hoc

## Dependencies (3)

- [react](https://npm.io/package/react.md) >=16.0.0
- [mutant](https://npm.io/package/mutant.md) >=3.21.0
- [@types/react](https://npm.io/package/@types/react.md) >=16.0.0

## Recent versions

- 1.1.0 (latest) — 2017-12-09
- 1.0.0 — 2017-12-09

## README

# react-mutant-hoc

```
npm install --save react-mutant-hoc
```

A utility function (higher-order component, 'HOC') that takes a React component as input, and returns a React component that behaves like the input but knows how to observe [Mutant](https://github.com/mmckegg/mutant) observables from props

## What problem this package solves

Let's say you have a normal React component that accepts normal props:

```jsx
<MyComponent isBlue={true} />
```

But you want the component to accept `isBlue` as a Mutant observable, and have that component automatically watch the observable and update accordingly.

## Usage

```js
import {withMutantProps} from 'react-mutant-hoc';

const MyMutantComponent = withMutantProps(MyComponent, 'isBlue');

// ... then in a render function ...
<MyMutantComponent isBlue={obs} />
```

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