CSFrequency / react-firebase-hooks

React Hooks for Firebase.
Apache License 2.0
3.58k stars 305 forks source link

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

Closed grojas123 closed 2 years ago

grojas123 commented 2 years ago

Hi I am using this :

const DatabaseValue = () => {
   const [snapshot, loading, error] = useObject(ref(database, `/messages`));
   return (
     <div>
       <p>
         {error && <strong>Error: {error}</strong>}
         {loading && <span>Value: Loading...</span>}
         {snapshot && <span>Value: {snapshot.val()}</span>}
       </p>
     </div>
   );
 };

And gave this error: Error: Objects are not valid as a React child (found: object with keys {001, 002}). If you meant to render a collection of children, use an array instead. If I use the original example did returned any value .

grojas123 commented 2 years ago

I am not using properly this .