import {Prompt} from ‘react-router-dom’; const Editor=()=>{ return ( <div> <Prompt // when相当于disabled,为true时,当react路由跳转就会触发 when={true} message={location => ‘文章要保存吼,确定离开吗?’} /> </div> ) }
react组件卸载前的钩子
猜你喜欢
转载自www.cnblogs.com/amiezhang/p/12294859.html
今日推荐
周排行