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

139
Views
¿La desestructuración anidada no funciona en React?

Así que hice un enrutamiento tranquilo en mi aplicación de reacción y quiero acceder a los parámetros.

Y esto funciona:

 const TreeList = ( props ) => { return ( <div> <p>{`Trees filterd by ${props.match.params.searchBy}, with the key of ${props.match.params.key}.`}</p> </div> ) }

También lo hace esto:

 const TreeList = ( {match} ) => { return ( <div> <p>{`Trees filterd by ${match.params.searchBy}, with the key of ${match.params.key}.`}</p> </div> ) }

Pero cuando traté de desestructurarlo aún más, me encontré con la desestructuración anidada de JS, que debería verse así:

 const TreeList = ( {match: {params}} ) => { return ( <div> <h1>TreeList</h1> <p>{`Trees filterd by ${params.searchBy}, with the key of ${params.key}.`}</p> </div> ) }

Pero no funciona. :(

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