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

267
Vistas
How do link my './Projects' file to app.js in React?
import "bootstrap/dist/css/bootstrap.min.css";
import Navbar from './components/Navbar';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import Home from './components/Home';
import Projects from './components/Projects';
import About from './components/About';

function App() {
  return(
    <>
      <Router>
        <Navbar />
        <Home  />
        <Projects />
        <About/>
      </Router>
    </>
  );
}

export default App;

This is the code in './Projects':

import React from 'react';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';

function Projects() {
    return (
        <h1>Proj</h1>
    );
}

export default Projects;

When I click the link for the Projects page the link doesn't display the content in function Projects(). Please help.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Try wrapping each component in a <Route> component. Something like this:

<Router>
  <Route path="/route/to/projects">
    <Projects/>
  </Route>
</Router>

There are a few different ways to do this with React Router. If you don't like the way I did it you can find more options here: React Router Routes

about 4 years ago · Juan Pablo Isaza Denunciar
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