Rebuild React Native Extended StyleSheet? -
i have app has various themes. theme stored in realm js.
the theme loads when first start app. i'm using react-native-extended-stylesheet styles.
it uses global variable $theme theme color.
user can save theme & theme gets saved in realm js stylesheet builds when first start app there no way theme changes right after saving. theme loads when again restart app.
import estylesheet 'react-native-extended-stylesheet'; const gettheme = () => { // call realm db & theme color } let theme = gettheme(); estylesheet.build({ $theme: theme, }); estylesheet.subscribe('build', () => { theme = gettheme(); }); so need way rebuild stylesheet when new theme saved using react-native-extended-stylesheet. tried subscribe method don't know how use correctly?
Comments
Post a Comment