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

148
Visualizações
Cant display a created user-email when using firebase in react

React newbie here, i have used firebase authentication to handle my user sessions. So i want when a person is loged in and wants to make payments, there email credentials to be displayed at the top of the payment page as part of there personal information but am not able to display the email details.

Instead i get an error saying (You may need an appropriate loader to handle this file type) Image of the error i get

import React from 'react';
import './Product.css';
import { useStateValue } from './StateProvider';

function payment() {
  const [{ basket, user }, dispatch] = useStateValue();

  return (
    <div className='payment'>
        <div className="payment__container">

            <div className="payment__section">
                    <div className="payment__title"> 
                          <h3>Delivery Address</h3>
                    </div>

                    <div className="payment__address">
                          <p>{user?.email}</p>
                    </div>
            </div>


            <div className="payment__section">

            </div>

            <div className="payment__section">

            </div>
        
        </div>
    </div> 
  )
}

export default payment 

I dont know how to go about the error.

The whole project code is here https://github.com/Elijah-A-W/Amazon-Clone-With-React/blob/master/src/Payment.js

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

You only need to make sure you have installed react-scripts 3.3.0+ version. In your case if you try with below code ,it will work. so the problem is optional-chaining is not working because of your react-script version.

<div className="payment__address">
                      <p>{user && user.email ?user.email:''}</p>
                </div>
about 4 years ago · Santiago Trujillo 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