title: objects are not valid as a React child (found: [object Promise]). If you meant to render a collection of children,
body: <p>When i try to render this code it always show this message &quot;objects are not valid as a React child (found: [object Promise]). If you meant to render a collection of children, use an array instead.&quot;. Please help me how to fix this error.This app is any example of rest api. Thanks in advance</p>
  <pre><code>let arr = [];
  
  function App() {
    let info = () =&gt; {
      return (axios
        .get(
          &quot;https://api.nasa.gov/planetary/apod?api_key=R4s5xcOxoYklREakJOSoeNMCOK4tpM8iqg6slJ15&amp;count=10&amp;hd=true&quot;
        )
        .then((res) =&gt; {
          Object.entries(res).map((val, i) =&gt; {
            return (
              &lt;div
                id=&quot;carouselExampleIndicators&quot;
                className=&quot;carousel slide&quot;
                data-bs-ride=&quot;carousel&quot;
              &gt;
                &lt;div className=&quot;carousel-indicators&quot;&gt;&lt;/div&gt;
                &lt;div className=&quot;carousel-inner&quot;&gt;
                  &lt;div className=&quot;carousel-item active&quot;&gt;
                    &lt;img
                      src={res.data[i].hdurl}
                      className=&quot;d-block w-100&quot;
                      alt=&quot;img&quot;
                    &gt;&lt;/img&gt;
                    &lt;br /&gt;
                  &lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            );
          });
        }))
    };
  
    return (
      &lt;&gt;
        &lt;div className=&quot;container&quot;&gt;{info()}&lt;/div&gt;
      &lt;/&gt;
    );
  }
  
  export default App;
  </code></pre>