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

156
Views
Matched leaf route at location "/profile/1" does not have an element. React Router V6

I have written a component

import { useState, useEffect } from "react";
import styled from "styled-components";
import { useParams } from "react-router-dom";
import colors from "../../utils/styles/colors";
import { ThemeContext } from "../../utils/contexte";



function Profile() {
   const { id: queryId } = useParams();
   const [profileData, setProfileData] = useState({});
   useEffect(() => {
      fetch(`http://localhost:8000/freelance?id=${queryId}`)
         .then((response) => response.json())
         .then((jsonResponse) => {
            setProfileData(jsonResponse?.freelaneData);
         });
   }, [queryId]);

   const { picture, name, location, tjm, job, skills, available, id } =
      profileData;

I am using this route in my index.js:

<Route path="/profile/:id" render={(props) => <Profile {...props} />}

But, the warning I am getting is:

index.tsx:25 Matched leaf route at location "/profile/1" does not have an element. This means it will render an with a null value by default resulting in an "empty" page.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

<Route path="/profile/:id" render={(props) => <Profile {...props} />}

use this instead of

<Route path="/profile/:id" element={<Profile props = {props} />} />
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!