Created
June 26, 2023 04:06
-
-
Save maskaravivek/a158f437245e4d502fe1a307d94af3b0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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