'does native-base have a utility method that allows us to extract computed theme data?

I am using native base and I want to use some of the theme values for example the primary text color and the main background color

I am looking for something that can take in a theme object as a parameter so I don't need to be in the context yet. So I can't use useTheme()

something along the lines of

computeStyle('Text', { colorScheme: 'primary` }, theme);

The second parameter being props that are applied to Text that may alter the result

The result should have a type of TextStyle | ViewStyle

The tricky bit I found so far is I don't have the theme context as of yet.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source