title: ReactJS window.addEventListener("hashchange") not working
body: <p>I have a React component called Home. Within Home, I have a function "urlListener" in which I have added an event listener to alert whenever the URL is being changed. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var Home = React.createClass({
   getInitialState: function () {
    return {
     openedFile: this.props.location.query.file || '',
     apps: [],
     showNav: this.props.location.query.file ? false : true,
     layout: 'row',
     cloneAppName: 'New Application',
     appName: 'Application Name',
     showSave: false
    }
   },
   urlListener: function(){
    window.addEventListener("hashchange", function(){
                         saveUnsaved();
    });
   },
          saveUnsaved: function(){
          }</code></pre>
  </div>
  </div>
  </p>
  
  <p>The listener works fine and is being called whenever there is a change in the URL. However, the console says that the function I'm trying to call is not a function. I am new to React and any help on this would be appreciated.</p>