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

159
Visualizações
My ReactJS pastReviews page component is no rendering when it is live

When I try to load the past reviews page of my React application, I am greeted with a blank page and the following error in my react dev tools console

Uncaught Error: PastReviews(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null"

The following consists of the function for the PastReviews page component:

function PastReviews(){
let navigate = useNavigate();
const [user] = useAuthState(auth);
if(!user){
    navigate("/");
}
const [review, setReview] = useState([]);
const reviewCollectionRef = collection(db, "review");
//this useEffect hooks contains an asynchronous function what fetches the dtata from firestore
useEffect(() => {

    const getReview = async () =>{
        const data = await getDocs(reviewCollectionRef);
        setReview(data.docs.map((doc) => ({...doc.data(), id: doc.id})))
    };
    getReview();
}, 
[]);
  
 //the following code displays the past reviews details from the firebase dataabase
 {review.map((review) => {
    return(
        <><Header /><Card>
            {""}
            <label className='reviewQ'>General description of your experience with the module</label>
            

            <label className='reviewQ'>What do you think of the lecturers teaching</label>
            

            <label className='reviewQ'>How were the module contents taught?</label>
            

            <label className='reviewQ'>How did you feel about the assessments</label>
            

            <label className='reviewQ'>How could teaching be improved</label>
          

            <label className='reviewQ'>How could assessments be  improved</label>
            

            <label className='reviewQ'>what did you think of the workload of this module</label>
       

            <label className='reviewQ'>give some extra feedback</label>

            <p>{review.q1}</p>
            <p>{review.q2}</p>
            <p>{review.q3}</p>
            <p>{review.q4}</p>
            <p>{review.q5}</p>
            <p>{review.q6}</p>
            <p>{review.q7}</p>
            <p>{review.q8}</p>
        </Card><Footer /></>
    ); 
})}
 

}

Any help and advice will be appreciated.

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

0

You are missing a return statement in the component. Also check for review to be defined.

return review && review.map((review) => {...})
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