Creating dynamic user home pages via a variable without requiring login

Viewed 57

does anyone know how I can create user generated home pages (like in Facebook user pages) without requiring login in React?

<BrowserRouter>
    <IntlProvider  messages={messages[locale]}>
      <Switch>
        <Route path="/admin" component={Admin} />
        <Route path="/mobile" component={Mobile} />
      </Switch>
    </IntlProvider>
</BrowserRouter>

For example: website.com/user1/mobile/home, website.com/user2/mobile/home.

Is there anyway to do it dynamically with a variable from a database?

1 Answers

Its possible not to require login, yes. However, how would your users get those variables to construct the URL?

I'd recommend using NextJS and use dynamic routes with static rendering, if those pages are mostly static.

Keep in mind this means anyone knowing the user ID will be able to see that specific user's page.

Related