React redirection problem?

beginners. I redirect to another component in one component

 constructor(props: any) {
        super(props);
        this.props.history.push("/auth_manage")
    };
The

redirection is successful, but the rest of the component"s functions (render ()) and the like are executed, so how do you jump out of this component directly here?

Mar.31,2022

in fact, this has misunderstood the idea of react-router. If you want to jump to another route after matching one route, you should use:

<Redirect from="" to=""/>

you should not jump after entering the route. If you enter the route and need to determine that certain conditions are met before you jump, and you must enter this page, then you need to write this in render or DidMount, because the execution of render cannot be prevented during initialization. You can write this in render

.
render() {
    if (xxxx) {
        this.props.history.push('/auth_manage');
        return '';
    }
    return 'xxxxx';
}

intuition tells me that it is return;


General overall large solution using routing
fundamentals using dynamic import
complete js package solution can use react-loadable, dynamic load build

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eb7c8e-473c4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eb7c8e-473c4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?