# frint-props-react

> React higher-order component FrintJS Apps

Latest version **0.2.1** (published 2018-03-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install frint-props-react
pnpm add frint-props-react
yarn add frint-props-react
bun add frint-props-react
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2018-03-29 |
| First published | 2017-12-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 15 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | frint-props Authors |
| Maintainers | avg206, fahad19, jbaudin, markvincze, mmirandaalex, oriente, rbardini, rmachado-travix, viacheslaff |
| Keywords | frint |

## Links

- npm: https://www.npmjs.com/package/frint-props-react
- Repository: https://github.com/frintjs/frint-props-react
- Homepage: https://github.com/frintjs/frint-props/tree/master/packages/frint-props-react
- Issues: https://github.com/frintjs/frint-props/issues
- npm.io page: https://npm.io/package/frint-props-react

## Recent versions

- 0.2.1 (latest) — 2018-03-29
- 0.2.0 — 2018-02-19
- 0.1.1 — 2018-02-16
- 0.1.0 — 2018-01-10
- 0.0.0 — 2017-12-29

## README

# frint-props

[![npm](https://img.shields.io/npm/v/frint-props.svg)](https://www.npmjs.com/package/frint-props)

> Compose props reactively in FrintJS Apps

<!-- MarkdownTOC autolink=true bracket=round -->

- [Guide](#guide)
  - [Installation](#installation)
  - [Usage](#usage)
- [API](#api)
  - [compose](#compose)

<!-- /MarkdownTOC -->

---

# Guide

## Installation

With [npm](https://www.npmjs.com/):

```
$ npm install --save frint-props frint-react
```

Via [unpkg](https://unpkg.com) CDN:

```html
<script src="https://unpkg.com/frint-props@latest/dist/frint-props.min.js"></script>
<script>
  // available as `window.FrintProps`
</script>
```

## Usage

The package exposes a `compose` higher-order component, that is similar to the one found in `frint-props`.

You can use it as follows:

```js
import React from 'react';
import { withDefaults, withState } from 'frint-props';
import { compose } from 'frint-props-react';

function MyComponent(props) {
  // props.counter (`Integer`)
  // props.setCounter (`Function`)
}

export default compose(
  withDefaults({ counter: 0 }),
  withState('counter', 'setCounter', 0)
)(MyComponent);
```

# API

## compose

> compose(...functions)(Component)

Higher-order component in React.

### Arguments

Accepts multiple functions as available in `frint-props`. The returned function is an enhancer that can be called directly with your base React component.

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