title: How can I retrieve stuff from an useState declared variable in a component within another component scope
body: <p>I want to get the investments variable within the scope of another component...</p>
  <p>I have written the code down-bellow which is ok, but how can I get this const investment since I already exported the function InvestmentsList? How can that be done without resorting to useSelector() from react-redux?</p>
  <pre><code>import React, { useEffect, useState } from 'react';
  import {
    Card,CardBody,CardHeader,CardTitle,Col,Row,Table} from 'reactstrap';
  import moment from 'moment';
  
  const InvestmentsList = () =&gt; {
    const [investment, setInvestment] = useState([]);
   async function fetchInvestments() {
      const response = await fetch('http://localhost:3000/products');
      const investments = await response.json();
      // waits until the request completes...
      setInvestment(investments);
    }
  
    useEffect(() =&gt; {
      fetchInvestments();
    }, []);
  
    return (
      &lt;&gt;{/* ...Returns something */}&lt;/&gt;)
  export default InvestmentsList;
  </code></pre>