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

148
Views
¿Cómo cambio mi valor de acceso a la tabla de reacción en función de los datos condicionalmente?
const data = { name:"test1", fclPrice:100, lclPrice:null, total:"50" }

y mis dos columnas:

 const Datatable = [ { Header: 'Name', accessor: 'name' }, { Header: 'Price', accessor:'?' }, { Header: 'Total', accessor:'total' } ];

Quiero que el acceso tome la clave de precio que tiene un número Por ejemplo: si fclprice: null y lclPrice: 100, debería tomar lclPrice y viceversa

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Puede establecer un valor de acceso a una función que tomará como primer argumento el objeto con sus datos. Luego, puede pasar cualquier condición que desee:

 const Datatable = [ { Header: 'Price', accessor: (data)=>data.fclPrice || data.lclPrice}, ];
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!