Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

117
Views
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 answers
Answer question

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 Report

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 Report

0

There is a typo mistake on component={ContractorInfoScreen}

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!