Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

244
Views
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 answers
Answer question

0

Got it :D

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

about 4 years ago · Juan Pablo Isaza Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!