Closed geohuz closed 4 years ago
I'm stumble upon structuring my code according the following code in the document:
const Todo = () => { const todo = useLocalStore(() => ({ title: "Test", done: true, toggle() { this.done = !this.done } })) return useObserver(() => ( <h1 onClick={todo.toggle}> {todo.title} {todo.done ? "[DONE]" : "[TODO]"} </h1> )) }
I can't figure out hwo to write my TodoList component's localStore? Or Should I just put the todos: [] inside the Todo component? I think I need more example code to help me out. Thanks!
todos: []
Please, don't double post, it won't expedite anything, just annoy people.
I'm stumble upon structuring my code according the following code in the document:
I can't figure out hwo to write my TodoList component's localStore? Or Should I just put the
todos: []
inside the Todo component? I think I need more example code to help me out. Thanks!