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

260
Visualizações
How to render button component in ScrollView array?

I have a ScrollView built out to swipe through images and render data points on each image. I'm running into a challenge with rendering ButtonRow on each image. Currently it's only rendering on 1 image, not each individual image.

So far I've attempted the following:

  • Calling component within the function, see below. This only renders ButtonRow on 1 image, not on each image
  • Inserting the ButtonRow as a data point within the array. This doesn't work at all, perhaps because my syntax was incorrect

Image:

    export default function DetailsScreen() {

  const [ property, setProperty ] = useState([
    { caption: 'blah', username: 'jane doe', photo: require('../assets/1.jpg'), key: 1 },
    { caption: 'caption', username: 'john doe', photo: require('../assets/2.png'), key: 2 },
  ])

  return (
    <View>
      {property.map((item) => {
        return (
          <>
            <View style={{ height: 812 }} key={item.key}>
              <View style={{ flexDirection: 'row', bottom: 220 }}>
                <ButtonRow />
              </View>
              <Image style={{ justifyContent: 'center', alignSelf: 'center', resizeMode: 'contain' }} source={item.photo} />
              <Text style={{ color: 'white', position: 'absolute', bottom: 150 }}>{item.username}</Text>
              <View style={{ flexDirection: 'row', position: 'absolute', bottom: 120 }}>
                <Caption
                  style={{ color: 'white', position: 'absolute', bottom: 120 }}
                  address={item.caption} />
              </View>
            </View>
          </>
        )
      })}
    </View>
  );
}

App.js

export default function App() {
  return (
    <View style={{ flex: 1, backgroundColor: 'pink' }}>
      <ScrollView
        snapToInterval='800px'
        decelerationRate="fast"
      >
        <DetailsScreen />
      </ScrollView>
    </View>
  )
}
about 4 years ago · Juan Pablo Isaza
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