Get UI Theme variables via hooks (instead of withStyles())
dandevs opened this issue · comments
dandevs commented
Issue type
I'm submitting a ... (check one with "x")
- bug report
- feature request
Issue description
Request in title, I believe it'd be much simpler to use a hook over the current withStyles()
method
Related code:
const Component = () => {
const theme = useKittenTheme();
const primary = theme["color-success-200"];
// Or something like
const styles = useKittenTheme(theme => ({
layout: {
backgroundColor: theme["color-success-200"]
}
});
<Layout style={styles.layout}/>;
return <Layout style={{backgroundColor: primary}>...</Layout>;
}
Other information:
**OS, device, application version **
UI Kitten 4.3.1
dandevs commented