sshyam-gupta / react-datamaps-india

React Datamaps for India Region
https://react-datamaps-india.vercel.app/
MIT License
8 stars 5 forks source link

Objects are not valid as a React child. #20

Closed AjayDhimanELS closed 3 years ago

AjayDhimanELS commented 3 years ago

Got the following in the console while trying the following in my App.js: Objects are not valid as a React child (found: object with keys {name}). If you meant to render a collection of children, use an array instead. Can you please help with it?

sshyam-gupta commented 3 years ago

@AjayDhimanELS can you please share small snippet of your code?

iravikds commented 3 years ago

Got the following in the console while trying the following in my App.js: Objects are not valid as a React child (found: object with keys {name}). If you meant to render a collection of children, use an array instead. Can you please help with it?

Same problem.

AjayDhimanELS commented 3 years ago

Sorry about my late reply, @sshyam-gupta - I tried everything as mentioned here. And as @iravikds is also facing the same issue. Can you please review your code and see if it actually works for you?. Thanks.

sshyam-gupta commented 3 years ago

Sorry @iravikds @AjayDhimanELS , I think the issue is with the README file.

can u try

hoverComponent={({ value }) => {
  return <span>{value.name}{value.value}</span>}}

instead of

hoverComponent={({ value }) => {
  return <span>{value}</span>
}}

I will update README soon.

AjayDhimanELS commented 3 years ago

Thanks.