# @emcasa/react-flagr

> React components to handle A/B testing with Flagr

Latest version **1.0.0** (published 2019-10-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @emcasa/react-flagr
pnpm add @emcasa/react-flagr
yarn add @emcasa/react-flagr
bun add @emcasa/react-flagr
```

## 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.0.0 |
| Published | 2019-10-17 |
| First published | 2019-10-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=7.6 |
| Dependencies | 1 |
| Unpacked size | 181.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | dev@emcasa.com |
| Maintainers | gabiseabra, glaet, lucas.tulio |

## Links

- npm: https://www.npmjs.com/package/@emcasa/react-flagr
- npm.io page: https://npm.io/package/@emcasa/react-flagr

## Dependencies (1)

- [hoist-non-react-statics](https://npm.io/package/hoist-non-react-statics.md) ^3.3.0

## Recent versions

- 1.0.0 (latest) — 2019-10-17

## README

# react-flagr

React components to handle A/B testing with Flagr.

## Usage

```js
import * as Flagr from 'react-flagr'

render(
  <Flagr.Provider entityId="some-device-token" url="http://flagr.server">
    <Flagr.Switch flagKey="some">
      <Flagr.Case variant="A">
        Render variant A
      </Flagr.Case>
      <Flagr.Case variant="B">
        Render variant B
      </Flagr.Case>
    </Flagr.Switch>
  </Flagr.Provider>
)
```

## Pre-loading flags

```js
import * as Flagr from 'react-flagr'

const flags = await Flagr.fetchFlagBatch([
  'flag-a',
  'flab-b'
], {
  id: 'some-device-token'
})

// ...

render(
  <Flagr.Provider
    flags={flags}
    entityId="some-device-token"
    url="http://flagr.server">
    {/* ... */}
  </Flagr.Provider>
)
```

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