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 568B

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