Open Wanderson77 opened 2 months ago
Hello devs, is there any example directory ready for React Native, or do we just have documentation to learn how to use this library?
Thanks!!!!
It works exactly the same as styled-components for the web. The only difference is when creating styled components:
import styled from "styled-components/native";
export const MyButton = styled.TouchableOpacity`
background-color: black;
padding: 20px;
`;
You may need to use some CSS commands that only work for react native, such as margin-horizontal, padding-vertical, elevation etc. If you're using typescript-styled-plugin
, add this code in jsconfig or tsconfig to prevent these CSS properties from reporting an error.
{
"plugins": [
{
"name": "typescript-styled-plugin",
"lint": {
"validProperties": [
"shadow-color",
"shadow-opacity",
"shadow-offset",
"shadow-radius",
"padding-horizontal",
"padding-vertical",
"margin-vertical",
"margin-horizontal",
"text-align-vertical",
"tint-color",
"elevation"
]
}
}
]
}
Hello devs, is there any example directory ready for React Native, or do we just have documentation to learn how to use this library?
Thanks!!!!