import { StyleSheet } from 'react-native'; import { createStylesArg } from '../types'; export function createStyles({ componentStyles, stylesProp, }: createStylesArg) { if (!stylesProp || !Object.keys(stylesProp).length) { return componentStyles; } for (const style in componentStyles) { if (stylesProp[style]) { componentStyles[style] = StyleSheet.compose( componentStyles[style], stylesProp[style] ) as any; } } return { ...componentStyles }; }