You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

rn_vshot.native.js 622B

123456789101112131415161718192021222324252627282930313233
  1. import ViewShot,{ captureScreen,captureRef } from "react-native-view-shot";
  2. // import { captureScreen,captureRef } from "react-native-view-shot";
  3. import React, { PureComponent,Component} from 'react';
  4. class ExampleCaptureOnMountManually extends Component {
  5. componentDidMount () {
  6. this.refs.viewShot.capture().then(uri => {
  7. console.log("do something with ", uri);
  8. });
  9. }
  10. render() {
  11. return (
  12. <ViewShot ref="viewShot" options={{ format: "jpg", quality: 0.9 }}>
  13. <Text>...Something to rasterize...</Text>
  14. </ViewShot>
  15. );
  16. }
  17. }
  18. export {ExampleCaptureOnMountManually}