import { createStoreConsumer } from "effector-react";
Deprecated

since effector-react 23.0.0.

Consider using hooks api in modern projects.

Methods

createStoreConsumer($store)

Creates a store-based React component which is watching for changes in the store. Based on Render Props technique.

Arguments

  1. $store (Store)

Returns

(React.Component)

Examples

import { createStore } from "effector";
import { createStoreConsumer } from "effector-react";

const $firstName = createStore("Alan");

const FirstName = createStoreConsumer($firstName);

const App = () => <FirstName>{(name) => <h1>{name}</h1>}</FirstName>;

Try it

Contributors