Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create nested routes ? I am trying to create nested route under /app but it's not working #555

Open
khalilchris opened this issue Aug 19, 2020 · 2 comments

Comments

@khalilchris
Copy link

khalilchris commented Aug 19, 2020

I am trying to create nested routes under /app but I can't get it to work

export default makeRouteConfig(
  <Route>
    <Route path="/" Component={SignIn} />
    <Route
      path="/app"
      Component={AppRoot}
      query={RoutesAppRootQuery}
      render={({ props, error, resolving }) => {
        if (error && resolving) {
          throw new RedirectException('/');
        }
        if (props) {
          const { match, router, user } = props;
          return <AppRoot match={match} router={router} user={user} />;
        }
        return <Loading />;
      }}
      fetchPolicy="store-and-network"
      prepareVariables={(params) => {
        const uuid = firebase.auth().currentUser?.uid;
        return {
          ...params,
          uuid,
        };
      }}
    >
      <Route path="account" Component={AccountMain} />
      <Route path="contacts" Component={Contacts} />
      <Route path="home" Component={Home} />
    </Route>
    <Route path="/vourtsa-editor" Component={VourtsaEditor} />
    <Route path="/terms-privacy" Component={TermsAndPrivacy} />
    <Route path="/support" Component={Support} />
    <Route path="/sales-refund" Component={SalesRefund} />
    <Route path="/guide" Component={Guide} />
    <Route path="/*" Component={PageNotFound} />
    <Route path="/create-account-options" Component={SignUpOptions} />
    <Route path="/create-account-email" Component={SignupWithEmail} />
    <Route path="/forgot-password" Component={ForgotPassword} />
    <Route path="/login-options" Component={SignInOptions} />
  </Route>,
);
@taion
Copy link
Member

taion commented Aug 19, 2020

Is your <AppRoot> component rendering its children? It should be getting one cloneElement-ed in.

@pkrakesh
Copy link

Did you try removing the prefixed / in subpaths? I mean for example / in "/vourtsa-editor".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants