native-base
Version:
Essential cross-platform UI components for React Native
13 lines (10 loc) • 317 B
text/typescript
import { useNativeBaseConfig } from './../core/NativeBaseContext';
export function useTheme() {
const theme = useNativeBaseConfig('useTheme').theme;
if (!theme) {
throw Error(
'useTheme: `theme` is undefined. Seems you forgot to wrap your app in `<NativeBaseProvider />`'
);
}
return theme;
}