Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

119
Visualizações
Route function removes all displayed items in react.js

I have a react js project that I am working on and whenever I put this code (that is neccessary for my website):

<Route path='/contractor/:id' component={ContactorInfoScreen}/>
<Route path='/' exact={true} component={HomeScreen}/>

all the text, images etc. all disapear from my page. I have made sure that I have imported all the neccessary items from the correct file paths. These are the things that I have imported:

import logo from './logo.svg';
import data from './data';
import { BrowserRouter, Route } from 'react-router-dom';
import './App.css';
import HomeScreen from './screens/HomeScreen';
import ContractorInfoScreen from './screens/ContractorInfoScreen';

Is there possibly another item that I need to import that I have not already done so?

about 4 years ago · Juan Pablo Isaza
3 Respostas
Responde à pergunta

0

Found the answer to my question. I needed to run this in the terminal:

npm install react-router-dom@5.3.0

I already had react-router-dom installed, just not the most recent revision.

Thanks for all the help that anyone has given. I really appreciate it

about 4 years ago · Juan Pablo Isaza Relatório

0

There seems to be a typo in the name of the component ContractorInfoScreen in your Html...

This

<Route path='/contractor/:id' component={ContactorInfoScreen}/>

should be

<Route path='/contractor/:id' component={ContractorInfoScreen}/>
about 4 years ago · Juan Pablo Isaza Relatório

0

There is a typo mistake on component={ContractorInfoScreen}

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda