react-native-typography icon indicating copy to clipboard operation
react-native-typography copied to clipboard

styled-components expect lineHeight to contain units

Open thomasarbona opened this issue 5 years ago • 2 comments

I'm trying to use the library with styled-components as mentioned in this example.

The problem is that styled expect the lineHeight to contain units, but there is none. As we can see, for example, human.title1Object:

Object {
  "backgroundColor": "transparent",
  "color": "#000000",
  "fontFamily": "System",
  "fontSize": 28,
  "fontWeight": "400",
  "letterSpacing": 0.355469,
  "lineHeight": 34,
}

If I use the object like this:

export const Title1 = styled(props => <Text {...props} />)`
  ${human.title1Object};
`;

I get this: 86185357_210672296735122_7868388049141366784_n

Should I hack the library and add a unit to the object by myself or I'm missing something?

Thanks 👋

thomasarbona avatar Feb 11 '20 00:02 thomasarbona

Guess it's more related to styled component and especially https://github.com/styled-components/css-to-react-native lib

ScreamZ avatar Feb 11 '20 15:02 ScreamZ

I resolved by using emotion instead

LRNZ09 avatar Aug 22 '20 14:08 LRNZ09