Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save maskaravivek/a158f437245e4d502fe1a307d94af3b0 to your computer and use it in GitHub Desktop.
Save maskaravivek/a158f437245e4d502fe1a307d94af3b0 to your computer and use it in GitHub Desktop.
import { useRef } from "react";
import { View, Button } from "react-native";
import ViewShot from "react-native-view-shot";
export default function MyCustomComponent() {
const ref = useRef();
return (
<Box>
<Button
onPress={() => {
captureAndShareScreenshot();
}}
>
Share
</Button>
<ViewShot ref={ref}>
<View>
<Text>My custom view...</Text>
</View>
</ViewShot>
</Box>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment