Skip to content
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

Styled #9

Open
ssomnoremac opened this issue Mar 23, 2017 · 0 comments
Open

Styled #9

ssomnoremac opened this issue Mar 23, 2017 · 0 comments

Comments

@ssomnoremac
Copy link
Contributor

ssomnoremac commented Mar 23, 2017

I've added an implementation of Styled Components for this library. Use regular object styles.

Needs to be tested but the idea is

import { Styled } from react-native-row

const GreenRow = Styled.Row({
    backgroundColor: "green"
})

<GreenRow dial={5} flex>
    <Text>Hi</Text>
</GreenRow>

Best of both worlds? My problem with Styles Components is that dial, or layout should be defined on the component instance itself. Layout is only visually relevant in relation to its context. So by putting layout styles in Styled definitions, you lose that context. Colors and other styles however, I'm fine to extract away. So this might get it done for some people. We'll see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant