Learn
Installation

Welcome to @effector/reflect

☄️ Attach effector stores to react components without hooks.

npm install @effector/reflect
# or
pnpm add @effector/reflect

Usage

import { reflect } from '@effector/reflect'
import { TextInput } from '@ui/lib';
 
import { $email, emailChanged, $formDisabled } from './model'
 
// Let's define bound component
const EmailField = reflect({
  view: TextInput,
  bind: {
    value: $email,
    onChange: emailChanged,
    disabled: $formDisabled,
  },
})

Now you can safely use it as common React-component:

export const LoginForm: React.FC = () => {
  return (
    <form>
      <EmailField type="email" autoComplete="email" />
    </form>
  )
}