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

361
Views
REACCIONAR- ¿Cómo puedo poner un guión (-) en mi celda vacía con mi condición?

¿Cómo puedo hacer para obtener un guión (-) si no tengo animales impresos en la celda de mi tabla? Con lo que he probado, mi celda queda vacía si tengo animals:[] :

 export default function Animals() { const data = useMemo(() => [ { Header: 'Animals', accessor: (row) => row.animals, Cell: (props) => ( <div> {props.value !== [] ? props.value.map(({ name }) => name).join(", ") : ''} {props.value.length > 0 && <InfoIcon position="right" message={props.value !== [] ? props.value.map((o) => ( <span key={o.name}> <b>{o.name}</b> <p>Type: {o.type}</p> <p>Price: {o.price}</p> </span> )) : '' } />} </div > ) } .... }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

usar lógica de condición ternaria en línea

 export default function Animals() { const data = useMemo(() => [ { Header: 'Animals', accessor: (row) => row.animals, Cell: (props) => ( { props.value !== [] && props.value.length > 0 ? <div> {props.value !== [] ? props.value.map(({ name }) => name).join(", ") : ''} {props.value.length > 0 && <InfoIcon position="right" message={props.value !== [] ? props.value.map((o) => ( <span key={o.name}> <b>{o.name}</b> <p>Type: {o.type}</p> <p>Price: {o.price}</p> </span> )) : '' } />} </div > : <div>-</div> } ) } .... }
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!