Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

126
Vistas
If you refresh react, you will be taken to the main page

After building the react environment with react-create-app --typescript, I used the Route, Redirect, and Switch functions with react-router-dom.

App.tsx

  <Switch>
    <QueryClientProvider client={queryClient}>
    <Redirect exact path="/" to="/main" />
    <Route path="/main" component={Main} />
    <Route path="/product/:id" component={Product} />
    <Route path="/search" component={Search} />
    </QueryClientProvider>
    </Switch>

index.tsx


    <BrowserRouter>
    <App />
    </BrowserRouter>,

Strangely dynamic page www.localhost:3000/product/1 2 3 4

In this way, if you try to enter after entering the domain, you will automatically be directed to the main page.

And click the dynamic id value on the main page to move to the id value detail page. If you refresh the detail page, you are automatically moved to the main main page. Why are you doing this? Redirect is not used.

I can't find the problem.

If you refresh the search component page other than the main page, you will be redirected to the main main page. I really don't know why this is.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda