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

365
Views
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
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!