title: Can you use array.push in useEffect? React Hooks
body: <p>I'm trying to figure out a way to add objects into my array. Here's the code.</p>
  <pre><code>export default function DashboardTable(props) {
      const { transactionData } = props;
      const classes = useStyles();
      const [transactionDataArray, setTransactionDataArray] = useState([])
  
   
    useEffect(() =&gt; {
      setTransactionDataArray(transactionDataArray.push(transactionData))
    }, [transactionData])
  
      console.log(transactionDataArray);
  </code></pre>
  <p>transactionData returns objects (the amount of objects is variable depending on the back end transactions.) I want to add the objects to the array <code>transactionDataArray</code> but I keep getting the error <code>transactionDataArray is not a function</code>. Where am I going wrong?</p>