Skip to content

Commit 905ca07

Browse files
authored
Replacing map with filter in an example
1 parent 9a3692d commit 905ca07

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/usage/deriving-data-selectors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ function TodoList() {
146146
// highlight-start
147147
// ❌ WARNING: this _always_ returns a new reference, so it will _always_ re-render!
148148
const completedTodos = useSelector(state =>
149-
state.todos.map(todo => todo.completed)
149+
state.todos.filter(todo => todo.completed)
150150
)
151151
// highlight-end
152152
}

0 commit comments

Comments
 (0)