Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

139
Views
¿Cómo paso un accesorio que contiene la ubicación de la imagen a la fuente de la imagen cuando renderizo muchas imágenes en una lista plana?

Mi código a continuación acepta inputPhotoLocation como accesorio. inputPhotoLocation contiene una lista de ubicaciones de fuentes de imágenes (que se han recuperado de un archivo que contiene una lista). Necesito una forma de pasarlos a mi fuente de imagen. He podido pasar las ubicaciones directamente en el cuadro de texto con éxito.

 function SelectionBoxComponent({inputPhotoLocation, inputText, onPress}) { return ( <TouchableWithoutFeedback onPress={onPress}> <View style={styles.box}> <View style={styles.circularPhoto}> <Image style={{height:"100%", width:"100%", borderRadius:70, borderWidth:0, source={require(inputPhotoLocation)}}} ></Image> {/* Here I need to insert the list items */} </View> <AppText style={styles.textStyle} onPress={console.log(inputText)} > {inputText}</AppText> </View> </TouchableWithoutFeedback>

Mi accesorio inputPhotoLocation contiene esto:

./assets/GroupImages/football.jpg

../assets/GroupImages/valley.jpg

../assets/GroupImages/usa.jpg

../assets/GroupImages/playstation.jpg

../assets/GroupImages/pc.jpg

Puedo pasar estas ubicaciones como salidas de texto con éxito. Sin embargo, no puedo averiguar cómo pasar estos en la fuente de la imagen.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

 <Image style={{ height: '100%', width: '100%', borderRadius: 70, borderWidth: 0, {/* The source prop is not a style prop */} source={require(inputPhotoLocation) }}></Image> <Image {/* The source prop is Image prop */} source={require(inputPhotoLocation) style={{ height: '100%', width: '100%', borderRadius: 70, borderWidth: 0 }}></Image>
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!