title: how to get parent component background color in child component in react native
body: <p>I want to pass value of backgroundColor of Parent component Card to child component CardSubTitle and change text color based on parent backgroundColor.
  React-native and babel is new for me and never used state. I tried using {...props} but it didnt worked.</p>
  <p>Card.js</p>
  <pre><code>const Card = (props) =&gt; {
    return (
      &lt;TouchableItem onPress={() =&gt; {}} useOpacity&gt;
        &lt;View style={[styles(props).card]}&gt;{props.children}&lt;/View&gt;
      &lt;/TouchableItem&gt;
    );
  };
  
  Card.propTypes = {
    onPress: T.func,
    title: T.string,
    color: T.string,
  };
  
  export default Card;
  
  </code></pre>
  <p>CardText.js</p>
  <pre><code>
  const Card = (props) =&gt; {
    return (
      &lt;TouchableItem onPress={() =&gt; {}} useOpacity&gt;
        &lt;View style={[styles(props).card]}&gt;{props.children}&lt;/View&gt;
      &lt;/TouchableItem&gt;
    );
  };
  
  Card.propTypes = {
    onPress: T.func,
    title: T.string,
    color: T.string,
  };
  
  export default Card;
  
  </code></pre>