# louis-xiv

> React state as a component

Latest version **0.0.2** (published 2018-04-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install louis-xiv
pnpm add louis-xiv
yarn add louis-xiv
bun add louis-xiv
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2018-04-02 |
| First published | 2018-04-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 12.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Rodrigo Pombo |
| Maintainers | pomber |
| Keywords | react, state, component, render-props, function-as-child |

## Links

- npm: https://www.npmjs.com/package/louis-xiv
- Repository: https://github.com/pomber/louis-xiv
- Homepage: https://github.com/pomber/louis-xiv#readme
- Issues: https://github.com/pomber/louis-xiv/issues
- npm.io page: https://npm.io/package/louis-xiv

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2018-04-02
- 0.0.1 — 2018-04-02

## README

> The state? I am the state.
>
> — <cite>Louis XIV</cite>

## Usage [![npm version](https://img.shields.io/npm/v/louis-xiv.svg?style=flat)](https://www.npmjs.com/package/louis-xiv)

Install:

```
$ yarn add louis-xiv
```

Use:

```js
import React from "react";
import State from "louis-xiv";

const App = () => (
  <State
    init={{ counter: 0 }}
    map={(state, setState, deferredSetState) => ({
      ...state,
      increment: () => setState(prev => ({ counter: prev.counter + 1 }))
    })}
  >
    {({ counter, increment }, setState, deferredSetState) => (
      <div>
        <h1>{counter}</h1>
        <button onClick={increment}>+</button>
      </div>
    )}
  </State>
);
```

## License

Released under MIT license.

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