Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

update object in array state react

const handleAdd = (todo) => {
  const newTodos = [...todos];
  newTodos.push(todo);
  setTodos(newTodos);
}
Source by dev.to #
 
PREVIOUS NEXT
Tagged: #update #object #array #state #react
ADD COMMENT
Topic
Name
1+2 =