react-native-responsive-screen icon indicating copy to clipboard operation
react-native-responsive-screen copied to clipboard

Margin Error Styled-Component

Open medelvann opened this issue 4 years ago • 2 comments

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"

medelvann avatar Mar 19 '20 18:03 medelvann

Try this instead

const margin = wp('2%')

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

make sure to add the backticks and try

anmolpandeyy avatar May 07 '20 17:05 anmolpandeyy

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

gregfenton avatar Aug 17 '20 06:08 gregfenton