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

181
Visualizações
React-native FlexDirection:'row' not working

I am trying to list these itemsNames into a row- put them horizontaly, but it is not working. I can't figure out the reason why. I would really appreciate some help

const Text = () => {

 const Menu = [
 {'id':1,
  'menuName':'whatever',
},

{'id':2,
'menuName':'whatever',
},

{'id':3,
'menuName':'whatever...',
},
];
  return (
    <View style={styles.container}><Text 
    >Test   
    </Text>
    {Menu.map((menuItems) => (
              <View style={styles.menuName}  key={menuItems.id} >
                <Text>{menuItems.menuName}</Text>
              </View>
            ))}
    </View>
  )
}
const styles = StyleSheet.create({
  container :{
    flex:1
 },
  menuName:{
    flexDirection: 'row',
    height: 48,
    width: '100%',
    borderWidth: 1,
    padding: 10,
  }

});
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Reason for not to work.

In order to arrange the items in a view, you need to set flexDirection='row' in your case items inside your View(Container) needed to be arranged horizontally so the flex-direction will be applied to View(Container)

Please make the following changes in style it will work.

container :{
  flex:1,
  flexDirection: 'row',
},
menuName:{
  height: 48,
  width: '100%',
  borderWidth: 1,
  padding: 10,
}

To study more about flex please following this link.

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