I'm a little stuck. I have put the user input results into an array that can be used on another component. However, when I try to deconstruct "newList" in another component/page, it doesn't display anything or when I console.log it returns [Object object]
.
This is where the data is put into the array
P粉1333218392024-04-06 10:49:01
First, in the formSubmit
function - you also want to propagate the input into the newList array, otherwise it will look like
[[{}, {}], {},{}]
So, to get the correct list, propagate the input as follows:
newList =[...input, ...userEnquiry] setUserEnquiry(newList)