我有一个疑问,因为应用程序没有显示主屏幕。具体来说,它只显示空白。
应该有一个 return 语句,因为 App 函数以 {} 而不是 () 开头
有人可以帮我吗?这是代码:
const App: React.FC = () => {
const [isReg, setIsReg] = useState(false);
useEffect(() => {
if(getItem("isRegistered")==null){
console.log(getItem("isRegistered"));
setIsReg(true);
}
else{
setIsReg(false);
}
}, []);
if(isReg){
return (
<IonApp>
<IonReactRouter>
<IonSplitPane contentId="main" when="(min-width: 4096px)">
<Menu />
<IonRouterOutlet id="main">
<Route path="/" component= {Registro } exact={true}/>
</IonRouterOutlet>
</IonSplitPane>
</IonReactRouter>
</IonApp>
);
}
else{
return (
<IonApp>
<IonReactRouter>
<IonSplitPane contentId="main" when="(min-width: 4096px)">
<Menu />
<IonRouterOutlet id="main">
<Route path="/" component= {Home} exact={true}/>
</IonRouterOutlet>
</IonSplitPane>
</IonReactRouter>
</IonApp>
);
}
};