Skip to content

Commit

Permalink
Only provide a default lineHeight when the fontSize is default
Browse files Browse the repository at this point in the history
  • Loading branch information
roryabraham committed Jul 9, 2021
1 parent 45a75c3 commit 41b7c07
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/Text.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,15 @@ const Text = React.forwardRef(({
const componentStyle = {
color,
fontSize,
lineHeight: 20,
textAlign,
fontFamily: fontFamily[family],
...mergedStyles,
};

if (fontSize === variables.fontSizeNormal) {
componentStyle.lineHeight = 20;
}

return (
// eslint-disable-next-line react/jsx-props-no-spreading
<RNText ref={ref} style={[componentStyle]} {...props}>{children}</RNText>
Expand Down

0 comments on commit 41b7c07

Please sign in to comment.