Westonci.ca is the best place to get answers to your questions, provided by a community of experienced and knowledgeable experts. Explore our Q&A platform to find reliable answers from a wide range of experts in different fields. Our platform provides a seamless experience for finding reliable answers from a network of experienced professionals.

How to use a state value in stylesheet in react native.

Sagot :

Answer:

Change this code:

return <View style={[styles.container, backgroundColor: this.state.bg]}/>

for this code:

return <View style={[styles.container, {backgroundColor: this.state.bg}]}/>

Thank you for visiting. Our goal is to provide the most accurate answers for all your informational needs. Come back soon. We appreciate your time. Please revisit us for more reliable answers to any questions you may have. We're glad you chose Westonci.ca. Revisit us for updated answers from our knowledgeable team.