Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

369
Vistas
React native view shot can't receive empty message

I want to export the image using React Native View Shot, but there is a problem, how come the image doesn't want to export, so there's an error like this. In English, it's like "shot can't receive empty message" enter image description here

this is my code

import ViewShot, { captureScreen } from 'react-native-view-shot';
const viewShotRef = useRef();
const [handleButton, setHandleButton] = useState(true);

async function captureViewShot() {
  setHandleButton(false);
  const imageURI = await viewShotRef.current.capture();
  console.log(imageURI);
  setHandleButton(true);
  Share.share({ title: 'Nota', url: imageURI });
}

function captureScreenShot() {
  captureScreen({
    format: 'jpg',
    quality: 0.8,
  }).then(
    (uri) => {
      console.log(uri);
      Share.share({ title: 'Nota', url: uri });
    },
    (error) => console.log('IMage gagal to', error)
  );
}

and this is my viewshot

<ViewShot
  ref={viewShotRef}
  style={{ flex: 1 }}
  options={{ format: 'jpg', quality: 1.0 }}>
  <Table borderStyle={styles.tableStyle}>
    <Row
      data={tableHead}
      style={styles.head}
      textStyle={styles.text}
      flexArr={[1, 2, 1, 1]}
    />
    <Rows data={tableData} textStyle={styles.text} flexArr={[1, 2, 1, 1]} />
  </Table>
</ViewShot>

in my case I need 2 exports, namely export only the table and export the whole screen but neither of them works

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda