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

232
Vistas
How do I reference a piece of data's name with a '-' in it, using react/JS?

I am looking to reference the total-fees property of an object:

The object

In react, the '-' causes problems in referencing this property. I have tried using camelCase, and quotations marks, but no luck.

The code attempt

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Got it :D

data.row.original['total-fees']

about 4 years ago · Juan Pablo Isaza Denunciar

0

You are using negate symbol(!) with the key, data.row.original.total-fees. What this means is that your return statement will run only when data.row.original.total-fees is false or 0, but it is actually null.

So, what you can try is:

1). console.log(data.row.original.total-fees); //output: null

2). if(data.row.original.total-fees===null) return "Response";

about 4 years ago · Juan Pablo Isaza Denunciar
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