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

96
Views
How to implement custom component that accepts a nested component?

I would like to implement a custom component that accepts a nested component. Something that can be used like this.

<MyCustomComponent>
  <AnyNestedComponent/>
</MyCustomComponent>

I searched about this but only found the use of this.props, which is not what I expect.

How do I implement MyCustomComponent in React Native version 0.68?

Note: MyCustomComponent will consist of View(s).

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

0

Its fairly simple in RN,

Your customComponent should be like =

const CumstomComp = ({props = {}, children = null}) => {

return(
<View style={{backgroundColor:"red"}} >

{children}

</View>

)

}

and then you use it like this

App.js or whatever file

const App = () => {

return(
<View>
 <CustomComp>
  <Flatlist />
  <View />
 </CustomComp>
</View>
)

}

Hope it helps. feel free for doubts

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!