Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

237
Vistas
Remove array map and handlers from render operation

I wrote this code a while ago and I came back to try and clean it by removing the map array and handlers out of the render operation but I keep getting syntax errors. How could I go about this? I'm getting the same error: Syntax error: Unexpected token, expected "," but varying on how I try to separate it.

 if (!sales) {
    return (
      <div>
        <Spinner />
      </div>
    );
  }

 return (
    <ul>
      {sales.map((result) => {
        const {
          sale_id,
          buyer,
          seller,
          listing_price,
          listing_symbol,
          created_at_time,
        } = result;

        function HandleBuyerClick() {
          window.location = '/user/' + buyer;
        }
        function HandleSellerClick() {
          window.location = '/user/' + seller;
        }

        if (buyer !== null) {
          return (
            <Card>
              <li key={sale_id}>
                <h3>
                  <Transaction>
                    <Button onClick={HandleSellerClick}>{seller}</Button>
                  </Transaction>{' '}
                  just sold item number
                  <Transaction>
                    <Button>{sale_id}</Button>
                  </Transaction>{' '}
                  to
                  <Transaction>
                    <Button onClick={HandleBuyerClick}>{buyer}</Button>
                  </Transaction>{' '}
                  for <Transaction>{formatNumber(listing_price)}</Transaction>{' '}
                  {listing_symbol} at {parseTimestampJM(created_at_time)}
                </h3>
              </li>
            </Card>
          );
        }
      })}
    </ul>
  );
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda