effector-react
Advanced tools
Changelog
effector-react 21.3.0
updateFilter
to useStoreMap
. It helps to control component rerendering, e.g. when component should rerender only when id
field is changeduseStoreMap($store, value => result)
shorthandgetKey
to useList
. Function in this field will be used to compute key for every item of listuseStore
(PR #431)createGate
to gate.displayName
and gate units (issue #449)useEvent
when used effect throw an errorChangelog
effector-react 21.2.0
createGate
implementation to effector-react/ssr
import {createDomain} from 'effector'
import {createGate, useGate} from 'effector-react/ssr'
const app = createDomain()
const currentRouteGate = createGate({
domain: app,
defaultState: 'dashboard',
})
export const Layout = ({routeName, children}) => {
useGate(currentRouteGate, routeName)
return (
<>
<h1>{routeName}</h1>
{children}
</>
)
}
Changelog
effector-react 21.1.0
useEvent
. It's a shorthand for calling several useEvent
at once (PR #425 by @sergeysova)export function ExampleComponent() {
const handlers = useEvent({emailChanged, passwordChanged})
return (
<div>
<input onChange={handlers.emailChanged} />
<input onChange={handlers.passwordChanged} />
</div>
)
}
export function ExampleComponent() {
const [changeEmail, changePassword] = useEvent([
emailChanged,
passwordChanged,
])
return (
<div>
<input onChange={changeEmail} />
<input onChange={changePassword} />
</div>
)
}
Changelog
effector 21.0.3, effector-react 21.0.4, effector-vue 21.0.3