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

260
Views
Cómo compartir capturas de pantalla de contenedores en React Native | Expo para Android

He creado una aplicación en la que quiero compartir un componente como una imagen. Lo estoy haciendo así.

 const shareImageHandler = async () => { try { const uri = await captureRef(containerRef, { quality: 1, format: "jpg", }); await Sharing.shareAsync(uri); console.log("action succeed"); } catch (error) { console.log("something went wrong!"); }

};

Pero estoy recibiendo este error.

[TypeError: undefined is not an object (evaluating '_expoSharing.default.shareAsync')]

el componente que quiero compartir como imagen.

 <ImageBackground ref={containerRef} source={{ uri: imgUrl ?? img() }} resizeMode="cover" style={styles.bgImg} > <View style={{ width: "100%", height: "100%", position: "absolute", top: 0, left: 0, backgroundColor: "rgba(0,0,0,.7)", }} /> <View style={styles.contentContainer}> <Text style={styles.quote}>&#8220; {content} &#8221;</Text> <Text style={styles.author}>&mdash;{data}</Text> </View> </ImageBackground>

He intentado muchas soluciones, pero nadie hizo el truco.

Nota: puedo guardar el componente como una imagen en la galería con éxito, es solo una nota al margen.

Esta aplicación se utilizará únicamente para dispositivos Android.

Gracias de antemano.

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

0

Debes estar importando mal la lib, a mi me paso lo mismo, estaba importando asi:

 import Sharing from 'expo-sharing';

pero la forma correcta es esta:

 import * as Sharing from 'expo-sharing';
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!