1.2.0 • Published 5 years ago

react-react v1.2.0

Weekly downloads
24
License
MIT
Repository
github
Last release
5 years ago

react-react · GitHub license npm Travis Coveralls github PRs Welcome

Impressive state management toolkit for react

Pros

  • Easy to use
  • Easy to read and maintain
  • Full hooks support
  • Low barrier to entry
  • Full react compatible
  • Small size
  • Flow and Typescript support
  • 100% test coverage

Installation

yarn add react-react

or

npm install react-react

How to use

First you should create component:

import * as React from "react";

class MyComponent extends React.Component {
    
}

To set state use setState function. For example

foo() {
    this.setState({ bar: "value" })
}

Access to state via state field:

render() {
    return <div>{this.state.bar}</div>
}

To use library just add following import to the beginning of you file:

import "react-react";

Usage with hooks

Create a functional component

import React from 'react'

function MyComponent() {

}

Add useState hook

function MyComponent() {
    const [value, setValueState] = useState("value")
    return <div>{value}</div>
}

To update value use setValueState

function foo(value) {
  setValueState(value)
}
1.2.0

5 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago