title: React Hook useEffect has a missing dependency Props
body: <p>In my react/redux app, i have an action that gets called to retrieve data from state in redux each time the component is mounted. My way does not work</p>
  <p>Below is the error I'm getting:</p>
  <blockquote>
  <p>React Hook useEffect has a missing dependency: 'props'. Either include it or remove the dependency array. However, 'props' will
  change when <em>any</em> prop changes, so the preferred fix is to destructure
  the 'props' object outside of the useEffect call and refer to those
  specific props inside useEffect  react-hooks/exhaustive-deps</p>
  </blockquote>
  <p>Here is my code:</p>
  <pre><code>import { getInvoiceData } from &quot;../../actions/tables&quot;
  
  const TableSection = (props) =&gt;{
  
    useEffect(() =&gt; {
      props.getInvoiceData();
    }, []);
  
  
    const classes = useStyles();
  
  (...)
  
  TableSection.propTypes = {
    invoiceData: PropTypes.object
  };
  
  const mapStateToProps = (state) =&gt; ({
    invoiceData: state.tables.invoiceData,
  });
  
  export default connect(mapStateToProps, { getInvoiceData })(TableSection);
  
  </code></pre>