3

I have one component for sign-in and sign-up.

For that i have one router like below:

 <Router>
      <div>
        <Routes>
          <Route path="/" element={<HomePage />} />
          <Route path="/account" element={<LoginAndRegisterPage />} />
        </Routes>
      </div>
    </Router>

By default i would reach sign-in page where path is =/account?sign-in

By clicking on button (below login form) i would like to add query params into path to = /account?sign-up and Link it into that path. Is it possible? Or is it a good way of doing so?

I3artosz
  • 123
  • 1
  • 11
  • Does this answer your question? [react-router v6: Navigate to a URL with searchParams](https://stackoverflow.com/questions/65800658/react-router-v6-navigate-to-a-url-with-searchparams) – Tanishq Vyas Dec 06 '21 at 09:25
  • Can you express your question more precisely? Are you asking how to pass a query string param to a `Link` component? Are you asking how to access a query string param in the routed component? Something else? Please update your question to share what you are trying to do. https://stackoverflow.com/help/minimal-reproducible-example – Drew Reese Dec 06 '21 at 18:25

0 Answers0