Home > Blockchain >  Objects are not valid as a React child (found: object with keys {seconds, nanoseconds}). If you mean
Objects are not valid as a React child (found: object with keys {seconds, nanoseconds}). If you mean

Time:03-19

I worked now 33 days straight to code my app. Everything works fine. Yersterday evening there occurs this error:

Error: Objects are not valid as a React child (found: object with keys {seconds, nanoseconds}). If you meant to render a collection of children, use an array instead.

I undo my changes, the error is still there. I decided to checkout an old commit. At the moment of commit, the codebase works. I have a running app in testmode on google play.

But today... even this code has this error. I could imagine this is a Firebase rules problem because they forced me after 30 days to change them. but after my changes the code runs for a while.

    [Unhandled promise rejection: Error: Objects are not valid as a React child (found: object with keys {seconds, nanoseconds}). If you meant to render a collection of children, use an array instead.]
at http://192.168.178.47:19000/node_modules/expo/AppEntry.bundle?platform=android&dev=true&hot=false&strict=false&minify=false:281758:22 in <unknown>

enter image description here enter image description here

CodePudding user response:

Firebase converts date/time to timestamp objects {seconds: number, nanoseconds: number} so if you passing that in the date field from your response object, you get that error. you have to convert the firebase date to javascript date or string. See this question from more

  • Related