Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

set nested state react hooks spread operator

setExampleState({...exampleState,  masterField2: {
        fieldOne: "a",
        fieldTwo: {
           fieldTwoOne: "b",
           fieldTwoTwo: "c"
           }
        },
   })
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #set #nested #state #react #hooks #spread #operator
ADD COMMENT
Topic
Name
6+9 =