|
Notices |
![]() |
|
Thread Tools | Rate Thread | Display Modes |
![]() |
#1 |
Registered User
Join Date: Dec 2012
Location: Los Angeles
Posts: 210
|
Facing React Error: Objects are not valid as a React child.
Greetings Everyone! I am currently building a react website for a homeopathic doctor. We are currently working on a part where we have to display the information of homeopathic doctors from the JSON object, but I am getting an error:
Error: Objects are not valid as a React child (found: object with keys {name, degree, specialty}). Here is the snippet of my component code: const doctorInfo = { name: "Dr. Sonal Mehta", degree: "BHMS", specialty: "Chronic Illnesses & Depression" }; return ( <div> <h2>{doctorInfo}</h2> {/* This line throws the error */} </div> ); I think it's related to the rendering of objects, but I am not sure how to fix it. Can anyone help me with the correct way of rendering the data in JSX? Your help will be beneficial. Last edited by markstyne; Yesterday at 02:04 AM.. |
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Vue might just be a clever copy of React? | sahithya | Programming General | 0 | 05-06-2024 02:59 AM |
VUE vs React | sahithya | Programming General | 0 | 04-07-2024 11:58 PM |
Top 5 popular React packages | sahithya | Programming General | 1 | 05-20-2022 04:17 AM |
Advantages of REACT from practice | sahithya | Programming General | 0 | 08-30-2021 01:28 AM |
Orlando Child Custody Attorneys | brownlawpl | General Discussion | 0 | 08-26-2016 11:04 PM |