Dive into the world of knowledge and get your queries resolved at IDNLearn.com. Discover reliable and timely information on any topic from our network of knowledgeable 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}]}/>

Your participation means a lot to us. Keep sharing information and solutions. This community grows thanks to the amazing contributions from members like you. IDNLearn.com has the solutions to your questions. Thanks for stopping by, and come back for more insightful information.