# react-tobe

> To be or not to be, that is the question

Latest version **1.0.6** (published 2020-05-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-tobe
pnpm add react-tobe
yarn add react-tobe
bun add react-tobe
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2020-05-04 |
| First published | 2019-07-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | joe06102 |
| Maintainers | joe06102 |
| Keywords | react, condition, if, else |

## Links

- npm: https://www.npmjs.com/package/react-tobe
- Repository: https://github.com/joe06102/React-Tobe
- Homepage: https://github.com/joe06102/React-Tobe#readme
- Issues: https://github.com/joe06102/React-Tobe/issues
- npm.io page: https://npm.io/package/react-tobe

## Dependencies (1)

- [@types/react](https://npm.io/package/@types/react.md) ^16.8.6

## 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

- 1.0.6 (latest) — 2020-05-04
- 1.0.5 — 2020-05-04
- 1.0.4 — 2020-05-03
- 1.0.3 — 2020-04-20
- 1.0.2 — 2020-04-18
- 1.0.1 — 2019-07-03
- 1.0.0 — 2019-07-03

## README

# React-Tobe
To be or not to be, that is the question !

## Declarative condition in jsx

## The Past

```javascript
export default ({ loading }) => {
    return loading ? <span>is loading</span> : <span> done </span>
}
```

## The Feature

With `react-tobe`, things are more react.

```javascript
import { Choose, Tobe, OrNot } from 'react-tobe'
export default ({ loading }) => {
    return (
        <Choose condition={loading}>
            <Tobe>is loading</Tobe>
            <OrNot>done</OrNot>
        </Choose>
    )
}
```

And it's easier to debug on the react devtools for conditional rendering!

## Lazy Rendering

With functional child component, element create can be deferred to specific branch rendering!

```javascript
import { Choose, Tobe, OrNot } from 'react-tobe'
export default ({ loading }) => {
    return (
        <Choose condition={loading}>
            <Tobe>is loading</Tobe>
            <OrNot>
            {
                () => <span> done </span>
            }
            </OrNot>
        </Choose>
    )
}
```

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