Created
January 18, 2021 15:12
-
-
Save vlas-ilya/26ad51f8a49898b3d4d8d9393fbefbce to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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