Skip to content

Generated stylesheet breaks, doesn't correctly change px to plain number #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

Closed
fxfactorial opened this issue May 2, 2017 · 4 comments

Comments

@fxfactorial
Copy link

fxfactorial commented May 2, 2017

Given this:

const TaskScrollWrapper = styled.ScrollView`
  padding: 10;
  background-color: red;
`;

const NewTaskBanner = styled.Text`
  font-size: 18px;
  text-align: center;
`;

  const content = (
    <TaskScrollWrapper>
      <NewTaskBanner> Hello World</NewTaskBanner>
    </TaskScrollWrapper>
  );

Then I get an error with RN "react-native": "0.42.0", this is with "styled-components": "^1.4.5",.
screen shot 2017-05-01 at 9 25 26 pm

Of course it does work when I drop the 'px', Thanks.

@jacobp100
Copy link
Contributor

Styled-components v1 is using v1 of this library. Unit support was only added in v2.

@fxfactorial
Copy link
Author

@jacobp100 Okay, so besides closing is there any advice? I should just wait until styled-components catches up?

@jacobp100
Copy link
Contributor

It's in SC v2, since it was a breaking change. Not sure what the timeline for that being released though!

@jacobp100
Copy link
Contributor

Also you can omit units for now, and we have a code transform to add them later.

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

No branches or pull requests

2 participants