# yreact

> a simple react

Latest version **0.0.4** (published 2018-01-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install yreact
pnpm add yreact
yarn add yreact
bun add yreact
```

## 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.0.4 |
| Published | 2018-01-11 |
| First published | 2018-01-09 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | yt1520406335 |

## Links

- npm: https://www.npmjs.com/package/yreact
- npm.io page: https://npm.io/package/yreact

## Recent versions

- 0.0.4 (latest) — 2018-01-11
- 0.0.3 — 2018-01-10
- 0.0.2 — 2018-01-10
- 0.0.1 — 2018-01-09

## README

## yReact
a simple react

```
git clone https://github.com/yt1520406335/yReact.git

cd example/helloWorld/

npm run start

open your browser
```

### use npm 

```
npm install yreact --save
```
### babel config

```
"plugins": [
    ["transform-react-jsx", {
        "pragma":  "y"
    }],
]
```

### use in project (l suggest you should not use... a ha)

```
import { render, Component } from 'yreact'
const containerNode = document.getElementById('app')

class SubApp extends Component {
    constructor(props) {
        super(props)
        this.state = {
        }
    }

    render() {
        const {name} = this.props
        return (
            <div>
                {name}
            </div>
        )
    }
}

class TopApp extends Component {

    constructor(props) {
        super(props)
        this.state = {
            name: 'hello world',
        }
    }

    render() {
        const { children } = this.props
        const { name } = this.state
        return (
            <div>
                <input 
                    onChange={e => {
                        this.setState({
                            name: e.target.value
                        })
                    }}
                    value={name}
                    style={{ border: '1px solid black' }}
                />
                <div>
                    {name}
                </div>
                <SubApp name={`name: ${name}`}/>
                <SubApp name={`name: ${name}`}/>
            </div>
        )
    }
}

render(<TopApp />, containerNode)

```
### learn from

- [implementation notes](https://reactjs.org/docs/implementation-notes.html)
- [preact](https://github.com/developit/preact)
- [tinyreact](https://github.com/ykforerlang/tinyreact) from my old-big-borther

### issue

[new a issue](https://github.com/yt1520406335/yReact/issues/new)

## update log

### 0.0.1
set up the environment to develop the project  
just support mount into dom

- not support lifecycle
- not support event
- not support Function component
- other

### 0.0.2

- support setState
- There are still a lot of problems.

### 0.0.3
- modify README.md

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