Skip to content

Instantly share code, notes, and snippets.

@Taym95
Last active March 5, 2019 12:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Taym95/be71afc6523f6d062d1e80adcaf0ab56 to your computer and use it in GitHub Desktop.
Save Taym95/be71afc6523f6d062d1e80adcaf0ab56 to your computer and use it in GitHub Desktop.
Take screenshot of a modal with react-native-view-shot
class ExampleCaptureModal extends Component {
onCapture = uri => {
this.refs.viewShot.capture().then(uri => {
console.log("do something with ", uri);
});
}
render() {
return (
<ViewShot ref="viewShot" options={{ format: "jpg", quality: 0.9 }}>
<Modal>Your Modal content</Modal>
</ViewShot>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment