MCPcopy Create free account
hub / github.com/expo/examples / Todo

Function Todo

with-tinybase/App.js:57–76  ·  view source on GitHub ↗
({ id })

Source from the content-addressed store, hash-verified

55
56// A single todo component, either 'not done' or 'done': press to toggle.
57const Todo = ({ id }) => {
58 const { text, done } = useRow(TODO_TABLE, id);
59 const handlePress = useSetCellCallback(
60 TODO_TABLE,
61 id,
62 DONE_CELL,
63 () => (done) => !done
64 );
65 return (
66 <TouchableOpacity
67 key={id}
68 onPress={handlePress}
69 style={[styles.todo, done ? styles.done : null]}
70 >
71 <Text style={styles.todoText}>
72 {done ? DONE_ICON : NOT_DONE_ICON} {text}
73 </Text>
74 </TouchableOpacity>
75 );
76};
77
78// A list component to show all the todos.
79const Todos = () => {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected