Pay attention
This documentation is for the as yet unreleased version of effector Spacewatch 23.0.

connect

Wrapper for useStore to use during migration from redux and class-based projects. Will merge store value fields to component props.

Recommendation

Consider using hooks api in modern projects.

connect(Store)(Component)

Formulae

connect(Store)(Component): Component

Arguments

  1. Store (Store): store or object with stores

Returns

(Component) => Component: Function, which accepts react component and return component with store fields merged in props

connect(Component)(Store)

Formulae

connect(Component)(Store): Component

Arguments

  1. Component (React.ComponentType): react component

Returns

(Store) => Component: Function, which accepts a store and return component with store fields merged in props

Contributors