# proppy-frint-react

> FrintJS + React integration with ProppyJS

Latest version **1.3.1** (published 2019-04-13) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.1 |
| Published | 2019-04-13 |
| First published | 2018-05-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 930 |
| Author | Fahad Ibnay Heylaal |
| Maintainers | fahad19 |
| Keywords | proppy |

## Links

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

## Recent versions

- 1.3.1 (latest) — 2019-04-13
- 0.1.0-alpha.c1609453 (canary) — 2018-05-25
- 1.3.0 — 2019-04-01
- 1.2.6 — 2018-09-07
- 1.2.5 — 2018-09-05
- 1.2.4 — 2018-07-19
- 1.2.3 — 2018-07-18
- 1.2.2 — 2018-06-16
- 1.2.1 — 2018-06-09
- 1.2.0 — 2018-06-03
- 1.1.0 — 2018-06-02
- 1.0.0 — 2018-05-29

## README

# proppy-frint-react

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

> FrintJS + React integration for ProppyJS

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

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

<!-- /MarkdownTOC -->

---

# Guide

## Installation

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

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

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

```html
<script src="https://unpkg.com/proppy@latest/dist/proppy.min.js"></script>
<script src="https://unpkg.com/proppy-frint-react@latest/dist/proppy-frint-react.min.js"></script>

<script>
  // available as `window.ProppyFrintReact`
</script>
```

## Usage

In your Root component, wrap it with `ProppyProvider` component, and it will take care of getting all the providers from your FrintJS app automatically:

```js
// components/Root.js
import React from 'react';
import { ProppyProvider } from 'proppy-frint-react';

import MyComponent from './MyComponent';

export default function Root() {
  return (
    <ProppyProvider>
      <MyComponent />
    </ProppyProvider>
  );
}
```

Now anywhere from your components tree, you can use the `attach` higher-order component:

```js
// components/MyComponent.js
import React from 'react';
import { compose, withProps } from 'proppy';
import { attach } from 'proppy-react';

const P = compose(
  withProps((props, providers) => {
    const { app, foo } = providers;

    return { foo: foo };
  }),
  withProps({ bar: 'bar value' }),
);

function MyComponent(props) {
  const { foo, bar } = props;

  return <p></p>;
}

export default attach(P)(MyComponent);
```

# API

## ProppyProvider

For setting providers at React's context-level.

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