React bindings for effector
npm install effector-reactReact bindings for effector
``bash`
npm install --save effector effector-react
Or using yarn
`bash`
yarn add effector effector-react
`js
import {createStore, combine, createEvent} from 'effector'
import {useUnit} from 'effector-react'
const inputText = createEvent()
const $text = createStore('').on(inputText, (_, text) => text)
const $size = $text.map(text => text.length)
const Form = () => {
const {text, size} = useUnit({
text: $text,
size: $size,
})
const handleTextChange = useUnit(inputText)
return (
useUnit in docs
Units in docs
createStore in docs
createEvent in docs