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

310
Views
Reaccionar: la imagen con uri indefinido no se actualiza en iOS

Estoy tratando de actualizar una imagen basada en una URL con estado (cambiando la URL a 'indefinido'). Por alguna razón, tengo que recrear la imagen en los dispositivos iOS o no se actualizarán... Mira este snack .

Aquí está el código:

 export default function App() { const [uri, setUri] = React.useState( "https://ichef.bbci.co.uk/news/640/cpsprodpb/150EA/production/_107005268_gettyimages-611696954.jpg" ); console.log({ uri }); // // Doesn't work on iOS if I do not pass a dynamic 'key' prop, // which will cause the recreation of the component... // const renderImage = () => <Image /* key={uri} */ resizeMode="cover" source={{ uri }} style={styles.image} /> return ( <View style={styles.container}> {renderImage()} <TouchableOpacity onPress={() => setUri(undefined)}> <Text style={styles.paragraph}> Remove Image! </Text> </TouchableOpacity> </View> ); }

¿Alguna idea de por qué sucede esto?

about 4 years ago · Juan Pablo Isaza
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!