更新时间:2022-12-17 09:12:34
你可以在 render 中使用 react-router 的 Redirect 组件.
You could use the Redirect component of react-router within render.
import { Redirect } from 'react-router'
render(){
(checkIfObjectEmpty)?<Redirect to = '/some_route'/>:<JSX>
}