How does react-router4 jump according to the judgment condition?

The

logic is like this: the project default route is home component , determine whether there is address in localStorage , if not, jump to address component to select an address, and then jump to home component . In vue, I judge in created and then use push to jump. React-rouer documents have read but still do not know how to do

.
Mar.30,2021

interface IDemo extends RouteComponentProps<{}>{}

class Demo extends React.Component<IDemo,{}>{
    
    componentDidMount(){
        if(!localStorage.get('XX)){
            this.props.location.history.push('/)
        }
      
    }

}
export default withRouter(Demo)

it's basically the same process to put

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-1bec4b5-31ad3.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-1bec4b5-31ad3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?