Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

176
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda