Tengo un StyleSheet de reacción con objetos.
const styleSheet = StyleSheet.create({ picture1: { height: 50, width: 30, alighItems: 'center', } picture2: { height: 50, width: 50:, alighItems: 'center', } }) Mi pregunta es: ¿Cómo asigno las propiedades de la imagen 1 a la picture2 2 y picture1 el ancho a 50?
Entonces, ¿podría escribir solo la imagen 2: {ancho: 50} sin tener que volver a escribir el mismo código?
Lo intenté de esta manera, pero desafortunadamente no funcionó.
const styleSheet = StyleSheet.create({ picture1: { height: 50, width: 30, alighItems: 'center', } picture2: { ...picture1, width: 50:, } }) const picture1 = { height: 50, width: 30, alignItems: 'center', // Note: alignItems not alighItems! } const styleSheet = StyleSheet.create({ picture1, picture2: { ...picture1, width: 50, } })