const{colors,setColors}=useContext(ColorThemeContext);//assume currently lightTheme is applied...<Textstyle={{color:colors.fontColor}}>text</Text>
Changing dark theme :
const{colors,setColors}=useContext(ColorThemeContext);//assume currently lightTheme is applied....functiononAction(){if(colors.type==='light'){setColors(mainColors.darkTheme);}else{setColors(mainColors.lightTheme);}}
Some comments may only be visible to logged-in visitors. Sign in to view all comments.
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (3)
idk whether this is the best approach but i think it may help you :
useContext hooks will work in this case. Create a separate colors file and create an object like this
Theme Provider Context :
Inside any component :
Changing dark theme :
Some comments may only be visible to logged-in visitors. Sign in to view all comments.