离子反应应用程序中的空白屏幕

时间:2021-01-19 00:14:06

标签: reactjs ionic-framework

我有一个疑问,因为应用程序没有显示主屏幕。具体来说,它只显示空白。

应该有一个 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>
          );
      }
      
    };

0 个答案:

没有答案