title: How to reload a URL without refreshing the page in ReactJs?
body: <p>I am trying to reload onto the same route without having to refresh the page. For this specific case, using <code>history.pushState()</code>, but I'm getting an error: </p>
  
  <blockquote>
    <p>TypeError: history.pushState is not a function.</p>
  </blockquote>
  
  <p>Here is my code: </p>
  
  <pre><code>import React from 'react';
  import PropTypes from 'prop-types';
  import { Container } from 'kawax-js';
  import { Switch, Route } from 'react-router-dom';
  import File from './FileContainer';
  import Folder from './FolderContainer';
  import HomeContainer from './HomeContainer';
  
  class RootContainer extends React.Component {
  
    static stateToProps = ({ ownProps, select }) =&gt; {
     const files = select('files');
     const lastFile =  _.last(files);
     return ({
      lastFile: lastFile || {}
   })
  };
  
    static propTypes = {
     history: PropTypes.object.isRequired
  };
  
    static defaultProps = {
     lastFile: {}
  };
  
  render() {
   const { lastFile, history } = this.props;
   if( lastFile === {} || !lastFile.isUploaded
    || lastFile.isUploaded === null) {
    return (
      &lt;Switch&gt;
        &lt;Route exact path="/" component={HomeContainer} /&gt;
        &lt;Route exact path="/file/:itemPath/:refHash" component={File} /&gt;
        &lt;Route exact path="/:folderName" component ={Folder}/&gt;
      &lt;/Switch&gt;
     );
    }
    return history.pushState(null, "/:folderName")
   }
  }
  
  export default Container(RootContainer);
  </code></pre>
  
  <p>Is there a better way of doing this or am I missing something here?</p>