-
Notifications
You must be signed in to change notification settings - Fork 90
Open
Description
Hi there, I'm having trouble getting themes to work:
I have this component:
export default class App extends Component<*, State> {
render() {
return (
<StyleProvider theme={{}}>
<SafeAreaView style={{ flex: 1 }}>
<Test/>
</SafeAreaView>
</StyleProvider>
);
}
}
That tries to use the Test component:
class _Test extends React.Component<{
style: Object
}> {
render() {
const styles = this.props.style;
return <View style={styles.test}>
<Text>TEST</Text>
</View>;
}
}
const Test = connectStyle('test', {
test: {
backgroundColor: 'red'
}
})(_Test);
As is, the element gets rendered with a red background.
When I try to change the theme's color, nothing happens:
export default class App extends Component<*, State> {
render() {
return (
<StyleProvider theme={{
'test': {
test: {
backgroundColor: 'green'
},
backgroundColor: 'green'
}
}}>
<SafeAreaView style={{ flex: 1 }}>
<Test/>
</SafeAreaView>
</StyleProvider>
);
}
}
What am I doing wrong? I've followed everything the docs said.
JedrzejMajko
Metadata
Metadata
Assignees
Labels
No labels