How to pass an array from a parent component to child component using props in React Native? | SoloLearn: Learn to code for FREE!

0

How to pass an array from a parent component to child component using props in React Native?

5/5/2020 2:07:34 AM

cmcodes

1 Answer

New Answer

0

Hi there, As you know javascript is a losely typed language. React is just a library for javascript. So, To pass an array in a component. <SomeCoolComp arr={this.state.arr}/> Whre, this.state={ arr:[] } Obviously, you will update this state with some value or you can just do "this.props.arr". This would work fine with react.