Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/408.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript ReactJS,使用localStorage覆盖重定向_Javascript_Reactjs_Jsx - Fatal编程技术网

Javascript ReactJS,使用localStorage覆盖重定向

Javascript ReactJS,使用localStorage覆盖重定向,javascript,reactjs,jsx,Javascript,Reactjs,Jsx,我有这个重定向代码: if( ( this.props.userQuery.user && this.props.userQuery.user.isMentee === true && this.props.userQuery.user.email_verified === false ) || ( this.prop

我有这个重定向代码:

if( 
        (
            this.props.userQuery.user && 
            this.props.userQuery.user.isMentee === true &&
            this.props.userQuery.user.email_verified === false
        ) ||
        (
            this.props.userQuery.user && 
            this.props.userQuery.user.isMentee === true &&
            this.props.userQuery.user.approved === false
        )
    ){
        return(
            <Redirect to={{
                pathname: '/settings/profile/'
            }}/>

        )
    }
if(
(
this.props.userQuery.user&&
this.props.userQuery.user.isMentee==true&&
this.props.userQuery.user.email_verified==false
) ||
(
this.props.userQuery.user&&
this.props.userQuery.user.isMentee==true&&
this.props.userQuery.user.approved==false
)
){
返回(
)
}
我想在重定向发生时显示此覆盖消息->

<div className="overlay-screen">
    <div className="action-panel">
    <h4 className="mb-2"><strong>Uh oh :(</strong></h4>
    <p>It looks like you haven't filled out your profile information yet. In order to ensure everyone has a great experience using our networking product, please make sure you fill out your profile information (avatar, bio, and social accounts) to provide our amazing mentors more information so they are able to learn more about you!</p>
    <p>If you are having any issues with updating your profile please <strong>start a live chat</strong> in the bottom right of the browser, or email <a href="mailto:help@designmentors.org">help@designmentors.org</a>.</p>
    <p><a className="button primary mb-2" href="/settings/profile">Update My Profile</a>.</p>
</div>

哦:(
您似乎还没有填写您的个人资料信息。为了确保每个人都有使用我们的网络产品的良好体验,请确保您填写您的个人资料信息(化身、个人信息和社交帐户),为我们的优秀导师提供更多信息,以便他们能够了解您的更多信息

如果您在更新个人资料时遇到任何问题,请在浏览器右下角启动实时聊天,或发送电子邮件


我需要在他们被重定向时显示覆盖。感谢帮助

我有两个想法,a.你可以创建一个toast,向用户显示重定向后发生的事情;B.你可以呈现一个模式组件,呈现覆盖消息,但在componentDidMount钩子中设置一个超时,该钩子将调用
history.push(“/settings/profile/”)
几秒钟后。我有两个想法,a.您可以创建一个toast,向用户显示重定向后发生的事情;B.您可以呈现一个模式组件,呈现覆盖消息,但在componentDidMount钩子中设置一个超时,该钩子将调用
history.push(“/settings/profile/”)
几秒钟后。