Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

269
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda