'React Native Restyle by shopify
Is there a way to access colours outside of components? It appears that any access to the styles is through hooks. I am using react-native-snackbar that accepts colours but runs through my middle ware so doesn't have any access to a component.
Solution 1:[1]
You can import theme.
import theme from './theme';
const { colors } = theme;
The theme object is created as -
export const theme = createTheme({ ... })
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Aseem Gautam |
