2

I want to know if conditional rendering between 3 page component is a professional way or should I do it different ?
Header is the navbar but I want it disappear when signIn or signUp page components will show.

With SignUp for now its like that -

 //userAccount is a Boolean 

return (
    <div> {userAccount ? (
        <SignUp  />
      ) : (
        <>
          <Header/>
           <Switch>
             <Route exact path='/'>
                <Home />
           </Route>
           <Route exact path='/search'>
            <Search/>
          </Route>
              </> )
        <div/>

When I add a SignIn page component I will have 2 conditions. I think it will look ugly & unprofessional.
Should I do an Auth Component where SignUp and SignIn will be shown - each by an authentication ?

Elassoa
  • 133
  • 2
  • 18

1 Answers1

0

Use import { NavigationContainer } from '@react-navigation/native'; to navigate with different pages for react

  • 2
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Vikram Parimi Sep 06 '22 at 20:00