Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

177
Views
Moved from React Native Stylesheet to Styled components. How to add elevation when styled components do not recognize elevation as a property?

I have the following simple component that used React Native Stylesheet up until now, but right now I'm trying to move onto Styled components. I'm just a bit confused how to apply elevation to the styled component, when it doesn't recognize elevation as a property?

const AuthFooter: FunctionComponent = ({ children }) => <View style={styles.buttonContainer}>{children}</View>;

const SCREEN_WIDTH = Dimensions.get('window').width;

const StyledView = styled.View`
    position: 'absolute';
    bottom: '0';
    width: ${SCREEN_WIDTH};
    padding: 20;
    background-color: ${colors.white};
    border-top-color: ${colors.creamTransparent200};
    border-top-width: 2;
    elevation: 10;
`;

const styles = StyleSheet.create({
    buttonContainer: {
        position: 'absolute',
        bottom: 0,
        width: SCREEN_WIDTH,
        paddingHorizontal: 20,
        backgroundColor: colors.white,
        borderTopColor: colors.creamTransparent200,
        borderTopWidth: 2,
        elevation: 10,
        paddingVertical: 20,
    },
});

export default AuthFooter;

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Unfortunately it is not possible to use the elevation in the css properties of the styled components, but you can add a View property like this:

const StyledView = styled.View.attrs({
    buttonContainer: {
        elevation: 10,
    }
})`
    position: 'absolute';
    bottom: '0';
    width: ${SCREEN_WIDTH};
    padding: 20;
    background-color: ${colors.white};
    border-top-color: ${colors.creamTransparent200};
    border-top-width: 2;
`;

If it still doesn't work as you expect, I recommend using this library.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!