-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with styled componets #35
Comments
could you upload example code? |
Styled use px as default unit. No working (Only styled) export const Text = styled.Text`
flex: 1;
font-weight: bold;
font-size: ${RFValue(18, 580)};
opacity: 0.78;
`;
// index.js
<Text allowFontScaling>
{text}
</Text> Solution: Working (Mix styled + react style) // style.js
export const Text = styled.Text`
flex: 1;
font-weight: bold;
opacity: 0.78;
`;
// index.js
<Text allowFontScaling style={{fontSize: RFValue(18, 580)}}>
{text}
</Text> |
Your code is wrong, try this: export const Text = styled.Text`
flex: 1;
font-weight: bold;
font-size: ${RFValue(18, 580)}px;
opacity: 0.78;
`; |
@TiagoDanin Have you tried? |
I put a wrong example, thanks. Update now
Yes this also work! but dp is different from px, recommend use in I don't see it as a problem, just commented so you could know why of no working with styled. |
I'm having trouble using this library with Styled Components, has anyone had this problem?
The text was updated successfully, but these errors were encountered: