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

99
Views
Usar Dynamic Wrapper para niños Reaccionar

Quiero usar un componente pasado de los accesorios para envolver niños, si está definido.

 interface ExampleProps { wrapper: JSX.Element; } function Example({ wrapper }: ExampleProps) { return ( // Wrap this with `wrapper`, only if it is defined, else don't wrap. <Child></Child> ) }

¿Cómo se puede hacer esto?

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

0

Puedes hacerlo de esta manera

 function Example({ wrapper }) { if(wrapper) { const Wrapper = wrapper //to make it alike component return <Wrapper><Child></Child></Wrapper> } return ( <Child></Child> ) }
about 4 years ago · Juan Pablo Isaza Report

0

Probar:

 function Example({ wrapper, children }) { const Wrapper = wrapper || React.Fragment; // custom components should start with capital letter return ( <Wrapper> {children} </Wrapper> ) }
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!