Skip to content

Commit

Permalink
imporve variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
latekvo committed Jul 5, 2024
1 parent 9f471cc commit 36f1a24
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/Pressable/Pressable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,11 @@ export default function Pressable(props: PressableProps) {
? props.children({ pressed: pressedState })
: props.children;

// StyleProp<ViewStyle> is a broad umbrella type
const normalizedStyles = StyleSheet.flatten((styleProp ?? {}) as ViewStyle);
// StyleProp<ViewStyle> is a broad umbrella type for objects, recursive arrays and numbers
const flattenedStyles = StyleSheet.flatten((styleProp ?? {}) as ViewStyle);

const innerStyles = extractStyles(normalizedStyles, innerStyleKeys);
const outerStyles = excludeStyles(normalizedStyles, innerStyleKeys);
const innerStyles = extractStyles(flattenedStyles, innerStyleKeys);
const outerStyles = excludeStyles(flattenedStyles, innerStyleKeys);

return (
<View style={outerStyles}>
Expand Down

0 comments on commit 36f1a24

Please sign in to comment.