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

268
Vistas
How can I change to horizontal alignment when using map in React native?

I have data called hello.

If I have hello[0] data, I want to run hello.map and list the buttons. However, the Pressable component is vertically aligned, but I want to do it horizontally.

So, I am trying to change the direction by giving a View on top of the map function. If i put a View, an Unexpected Token error occurs.

How do I fix my code?

hello = [
{ originName: "growthLength 1"},
{ originName: "growthLength 2"},
]



{
hello[0] ? (
<View style={{flexDirection:'row'}}>    // << here

hello.map((v) => {
return(
<>
    <Pressable>
        <Image />
    </Pressable>
</>
)
})

</View>   
) : (null)
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Change your code like this

{hello[0] ? (
    <View style={{ flexDirection: 'row' }}>
    {hello.map((v) => {
        return (
        <>
            <Pressable>
            <Image />
            </Pressable>
        </>
        );
    })}
    </View>
) : null}
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