3 ms·
ReactJS Easy State (https://github.com/solkimicreb/react-easy-state https://github.com/solkimicreb/react-easy-state) is a practical state management library wit
by miklosbertalan 8y ago
ReactJS Easy State (https://github.com/solkimicreb/react-easy-state https://github.com/solkimicreb/react-easy-state) is a practical state management library with two functions and two accompanying rules.
1. Always wrap your components with view().
2. Always wrap your state store objects with store().
import React from 'react'
import { store, view } from 'react-easy-state'
const counter = store({
num: 0,
incr: () => counter.num++
})
export default view(() => <button onClick={counter.incr}>{counter.num}</button>)
---
This release adds support for the upcoming React hooks.