From f077e4df6f2cf17b0896b3638c42427d34250609 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E5=98=89=E8=AF=9A?= <425765923@qq.com> Date: Thu, 8 Feb 2024 11:41:49 +0800 Subject: [PATCH] =?UTF-8?q?[Issues:=20#I91I34]=20react-native-view-shot=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9EViewShot=20=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zh-cn/react-native-view-shot.md | 100 ++++++++++++++++++++++---------- 1 file changed, 69 insertions(+), 31 deletions(-) diff --git a/zh-cn/react-native-view-shot.md b/zh-cn/react-native-view-shot.md index 6b25d366..a031e461 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 - - -