Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 48981

Elvis operator in Ionic React does not work

$
0
0

I have 2 variables that determine which components to render. personalInfo and cliente.

The problem I have is that when personalInfo equals false, the CompleteInfo component is not displayed (rendered). Instead, HomeCliente or HomeProveedor is rendered depending on the client variable.

<Route path="/home" render={() =>   ( personalInfo ? (cliente ?  <HomeCliente /> : <HomeProveedor /> ) :  <Completarinfo setRenderAgain={setRenderAgain} />   )  } ></Route>

Apparently the operator elvis is walking backwards. What is the problem here?

return(
<IonApp>
<IonReactRouter>
<IonSplitPane contentId="main" when="(min-width: 4096px)">
      <Menu renderAgain={renderAgain} />
  <IonRouterOutlet id="main">

    <Route path="/home" render={() =>   ( personalInfo ? (cliente ?  <HomeCliente /> : <HomeProveedor /> ) :  <Completarinfo setRenderAgain={setRenderAgain} />   )  } ></Route>
  

  </IonRouterOutlet>
  </IonSplitPane>
</IonReactRouter>
</IonApp>

);
};

6 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 48981

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>