effector-react 23.3.0-aaf6a4a8
Install from the command line:
Learn more about npm packages
$ npm install @effector/effector-react@23.3.0-aaf6a4a8
Install via package.json:
"@effector/effector-react": "23.3.0-aaf6a4a8"
About this version
React bindings for effector
npm install --save effector effector-react
Or using yarn
yarn add effector effector-react
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 (
<form>
<input
type="text"
onChange={e => handleTextChange(e.currentTarget.value)}
value={text}
/>
<p>Length: {size}</p>
</form>
)
}
useUnit in docs Units in docs createStore in docs createEvent in docs
Details
- effector-react
- effector
- about 1 month ago
- MIT
- 3 dependencies
Assets
- effector-react-23.3.0-aaf6a4a8.tgz
Download activity
- Total downloads 0
- Last 30 days 0
- Last week 0
- Today 0