text: import {Redirect} from "react-router-dom";
  import PropTypes from "prop-types";
  
  /**
   *
   * Another way to export directly your functional component.
   */
  export const RegisterGuard = props => {
    if (!sessionStorage.getItem("token")) {
      return props.children;
    }
    // if user is already logged in and hence registered, redirects to the main /app
    return <Redirect to="/dashboard"/>;
  };
  
  RegisterGuard.propTypes = {
    children: PropTypes.node
  }