Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

add new array at the back of react state

this.setState(prevState => ({
  myArray: [...prevState.myArray, {"name": "object"}]
}))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #add #array #react #state
ADD COMMENT
Topic
Name
2+5 =