首页 > 如何取得navigator当前router name

如何取得navigator当前router name

想根据当前router来判断哪个页面不显示NavigationBar,大家有没有好方法,谢谢


const {navigator} = this.props;

const routes = navigator.getCurrentRoutes();
const currentRoute = routes[routes.length - 1];

if (currentRoute.name === "your route name") {
    // reuturn view;
}
【热门文章】
【热门文章】