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

164
Visualizações
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 Respostas
Responde à pergunta

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 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