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. 

```js
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(){
        }
```

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.