Skip to content

Instantly share code, notes, and snippets.

@vlas-ilya
Created January 18, 2021 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vlas-ilya/26ad51f8a49898b3d4d8d9393fbefbce to your computer and use it in GitHub Desktop.
Save vlas-ilya/26ad51f8a49898b3d4d8d9393fbefbce to your computer and use it in GitHub Desktop.
import { useStore } from 'effector-react'
import { useEffect } from 'react';
import { pageMounted, listStore, stateStore } from './TodoList.store';
const TodoList = () => {
useEffect(pageMounted, []);
const list = useStore(listStore);
const state = useStore(stateStore);
return (
<div>
<div>{state}</div>
{list.map(item => (
<div key={item.id}>
{item.value}
</div>
))}
</div>
)
}
export default TodoList;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment