react hook项目中 在useEffect中获取localStorage的值为空时跳转页面 造成无限循环 两个页面之间来回切换
const ApptoLink=()=>{
window.jsInterface.jump('/CheckHome');
}
useEffect(() => {
console.log('------------------',localStorage.getItem('personID'))
const per=localStorage.getItem('personID')
if(per===null){
ApptoLink()
Toast.success('暂未获取到房源信息,请选择住所');
}