score:1

Accepted answer

you have three quotes for phone key when setting the state in handlesubmit function, this gives an error.

you have missed the closing tag for <form> component inside addpersonform.

you have an extra curly bracket before the return statement of addpersonform.

inside peoplelist component where you have mapped the listitems you are directly trying to render val, which is a contact object, inside li. react is complaining for that and you get error in console:

objects are not valid as a react child (found: object with keys {name, age, location, phone}).

so maybe change it to something like {val.name} and it'll work.


Related Query

More Query from same tag