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.
Source: stackoverflow.com
Related Query
- how can I display a list of contacts with name, age, location, and phone props in react? my code does not display anything
- How can you set path of match with MemoryRouter and Jest? (not location or history)
- How can I Fetch and display Mysql data into ReactJS front end with Node JS as backend?
- How can i use useParams() with an onClick button to navigate to different pages and display the data in react.js?
- How can I fetch base64 encoded images (string) from a URL/ API and display in ImageField or on react-admin list or show page
- How can you pass props and use HOC with React context
- How can I display web vitals metrics into my page footer with nextjs and react hook?
- How can I map array with multiple objects and display on chart?
- How can I display map full screen and centered with react-simple-maps
- How can I add a user input with an output and be able to display using React Javascript/ Material UI
- I created a button dynamic with the functional components, how I can get style and size from users as props
- relation between reactjs ,setState, Interface props and Interface state with respect to typescript , how can I use setState?
- How to write a code to display a page with photo, text and and name
- How can I enable react-i18n translation file to be used in the unit tests done with react-testing-library and jest?
- How can I develop locally using a domain name instead of 'localhost:3000' in the url with create-react-app?
- How can I use React with Google Places API, to display place markers on a Google map?
- How to deal with different variable name convention in backend api and frontend
- How to filter a list based on user input with ClojureScript and Om?
- how can I test if useState hook has been called with jest and react testing library?
- How to use custom props and theme with material-ui styled components API (Typescript)?
- Make cards and images the same size - how can I do it with CSS?
- How to TypeScript a props interface containing an object and merge with defaultProps
- React and NextJS: How can i detect the Location of my Client?
- How to validate min age with yup and moment.js?
- how to change image src using props with styled component and react
- How can I center my clip-path's text relatively to the viewport and display all the clip-path's text?
- How to display the result of Select query on list with ReactJS?
- how to make google bots crawl my react website with dynamic urls and display them in google
- How can I configure react-router to with nginx/cherrypy and my current reactjs app
- How can I save multi-line code snippets in MongoDB, retrieve and display them in HTML
More Query from same tag
- React useState with WebSocket causes array to not update correctly
- Flickering with Apollo Queries
- Array.map() doesn't render React component
- How do I dynamically toggle multiple layers in Deck.gl?
- Elements are going inside the nav bar css react
- Typescript-React State: Element implicitly has an 'any' type because type 'State' has no index signature
- React element resets even when its `key` prop is kept the same
- Typescript: Different Types in different classes with same variable
- React - Ignore subnodes
- || operator in arguments
- formData.append() is not sending file to the server?
- Why Navigate to a route not working in react?
- React using graphQL apollo refetch will also update other components
- Close Popover on click in child component
- React JoditEditor insert image not working
- Populating stateless child component props from parent component state to display nested unordered list in React (with Firebase)
- ReactJS when using if-rendering there is component that disappears
- Using JOIN and COUNT to find totals SQL
- How to change the value of all the objects inside the expect except the one which is clicked in React js?
- React: Returning iterated list from a stateless component
- How to handle asynchronous call in redux react application
- How do you set a event listener/handler if someone types in the address bar?
- Reactjs: Are there advantages to using React components over normal functions?
- Fetch in a Web Worker using React
- Webpack React library to global variable in window
- How to test react-router with enzyme
- Enzyme - TS2350: Only a void function can be called with the 'new' keyword
- Passing props through too many levels
- Migrating from createContainer to withTracker in Meteor / React
- React: Handle dynamic refs with custom hook