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

Margin Error Styled-Component #74

Open
medelvann opened this issue Mar 19, 2020 · 2 comments
Open

Margin Error Styled-Component #74

medelvann opened this issue Mar 19, 2020 · 2 comments

Comments

@medelvann
Copy link

medelvann commented Mar 19, 2020

hi, for this code i get a error :
Error:Failed to parse decleration margin:13 in styled-compnent usage

const ViewCoverHeader =styled.View`
margin:${wp('2%')};
`;

update:
i added px at the end of line and fixed,
margin:${wp('2%')}px;
but this problem not happening for with and height

im using this version of styled-component
"styled-components": "^4.0.0"

@anmolpandeyy
Copy link

anmolpandeyy commented May 7, 2020

Try this instead

const margin = wp('2%')

const ViewCoverHeader =styled.View
margin:${margin};

make sure to add the backticks and try

@gregfenton
Copy link

@medelvann - did @anmolpandeyy's suggestion work? Can this issue be closed?

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

3 participants