diff --git a/zh-cn/react-native-view-shot.md b/zh-cn/react-native-view-shot.md index 6b25d3667e711dd22f03b48e58f411846df45d1e..a031e461eafda8e5a569ac1ffc5ab41cd6f422b2 100644 --- a/zh-cn/react-native-view-shot.md +++ b/zh-cn/react-native-view-shot.md @@ -45,40 +45,64 @@ yarn add @react-native-oh-tpl/react-native-view-shot@file:# ```js import React from "react"; import { View, Text, Button } from "react-native"; -import { captureRef, captureScreen } from "react-native-view-shot"; +import ViewShot, { captureRef, captureScreen } from "react-native-view-shot"; export default function App() { - const view = React.useRef < View > null; + const view = React.useRef(null); + const ref = React.useRef(null); + const onCapture = (uri) => { + console.info("onCapture callback"); + setTxt(JSON.stringify(uri)) + }; + const onCaptureFailure = (err) => { + console.info("onCaptureFailure " + JSON.stringify(err)); + setTxt(JSON.stringify(err)) + }; + const [txt, setTxt] = React.useState(''); + return ( - - + + Hello OpenHarmony Hello HarmonyOS - Hello HarmonyOS Next + Hello HarmonyOS Next. - Hello World - - -