import type { StyleProp } from 'react-native'; export const getPropertyFromStyle = ( style: StyleProp | StyleProp[] | null, key: keyof StyleProp, ) => { return Array.isArray(style) ? style.filter(theStyle => theStyle?.[key])?.slice(-1)?.[0]?.[key] : style?.[key]; };