title: How To Connect Redux To React Functional Component
body: <p>The error I'm getting is "TypeError: Cannot set property 'props' of undefined".</p>
  
  <p>What I was trying to do is to connect redux to my functional (stateless) component.
  I guess that I wrote it wrong, but I can't figure out how to write it correctly and make it work.  </p>
  
  <pre><code>import React from 'react'
  import { connect } from 'react-redux'
  
  
  const Logger = (props) =&gt; {
      console.log(props.event);
  
      let logger = []
  
      if(localStorage.getItem("logger")){
        logger = JSON.parse(localStorage.getItem("logger"))
      }
  
      let d = new Date();
      let h = d.getHours();
      let m = d.getMinutes();
      let s = d.getSeconds();
      let time = (h + ":" + m + ":" + s)
  
      logger.push(
        {
          time: time,
          event: props.event
        }
      )
  
      localStorage.setItem("logger", JSON.stringify(logger))
      props.logger(logger)
  }
  
  const mapDispatchToProps = (dispatch) =&gt;{
    return{
      logger: (value) =&gt; {
        dispatch({
          type: 'LOGGER',
          payload: value
        })
      }
    }
  } 
  
  export default connect(null, mapDispatchToProps)(Logger)
  
  
  </code></pre>