diff --git a/en/react-native-async-storage-async-storage.md b/en/react-native-async-storage-async-storage.md index 652e68b565bb4dd10ef17460a6bb1075f541806c..795d63dc252711002bcc2fab03cc48240d1d976d 100644 --- a/en/react-native-async-storage-async-storage.md +++ b/en/react-native-async-storage-async-storage.md @@ -82,10 +82,10 @@ export default function App() { const readItemFromStorage = async () => { const item = await getItem(); - setValue(item); + setValue(item === null ? '' : item); }; - const writeItemToStorage = async (newValue) => { + const writeItemToStorage = async (newValue: any) => { await setItem(newValue); setValue(newValue); }; diff --git a/en/react-native-community-geolocation.md b/en/react-native-community-geolocation.md index d88de7f185b50ff8bdf48a477a22fa3a7c81d459..23a617e2e4d6d5c13be71a240cbeae24079837da 100644 --- a/en/react-native-community-geolocation.md +++ b/en/react-native-community-geolocation.md @@ -45,6 +45,7 @@ The following code shows the basic use scenario of the repository: ```js import Geolocation from "@react-native-community/geolocation"; import { Button } from "react-native"; +import React from 'react'; export function GeolocationDemo(): JSX.Element { const tap = () => { @@ -272,7 +273,7 @@ Open the `entry/src/main/resources/base/element/string.json` file and add the fo ## Known Issues -- [ ] @react-native-oh-tpl/geolocation 部分属性未完全实现 HarmonyOS 化,maximumAge 延时问题: [issue#6](https://github.com/react-native-oh-library/react-native-geolocation/issues/6) +- [ ] Some attributes of @react-native-oh-tpl/geolocation have not been fully implemented for HarmonyOS, and there is a delay issue with maximumAge: [issue#6](https://github.com/react-native-oh-library/react-native-geolocation/issues/6). ## Others diff --git a/en/react-native-drag-sort.md b/en/react-native-drag-sort.md index 9f224948485fb9c62f53aa93fc94ee019029d9b3..d85f507c017545d6618c666d114ec95f89352039 100644 --- a/en/react-native-drag-sort.md +++ b/en/react-native-drag-sort.md @@ -304,10 +304,16 @@ const bottomViewHeight = 40; const getW = (index, isWidth) => isWidth ? (index % 3 === 0 ? width - 40 : (width - 60) / 2) : 80; -export default class AnySizeDragSortDemo extends React.Component { +type State = { + items: { text: string, width: number, height: number }[]; + movedKey: any +} + +export default class AnySizeDragSortDemo extends React.Component { + sortableViewRef: React.RefObject; constructor(props) { super(props); - const items = []; + const items:State["items"] = []; for (let i = 0; i < 26; i++) { items.push({ text: String.fromCharCode(65 + i), diff --git a/zh-cn/react-native-async-storage-async-storage.md b/zh-cn/react-native-async-storage-async-storage.md index 47876ae2b90eb3ace30293b70c9abd4e6a040f69..11572d4b8e454b0a03acfb968560483237701419 100644 --- a/zh-cn/react-native-async-storage-async-storage.md +++ b/zh-cn/react-native-async-storage-async-storage.md @@ -80,10 +80,10 @@ export default function App() { const readItemFromStorage = async () => { const item = await getItem(); - setValue(item); + setValue(item === null ? '' : item); }; - const writeItemToStorage = async (newValue) => { + const writeItemToStorage = async (newValue: any) => { await setItem(newValue); setValue(newValue); }; diff --git a/zh-cn/react-native-community-geolocation.md b/zh-cn/react-native-community-geolocation.md index 567842499a71dded1ba43db7a81e75f372a8bcf8..7774b0ae5d981948aa8acdcedb3ae460dd6dfead 100644 --- a/zh-cn/react-native-community-geolocation.md +++ b/zh-cn/react-native-community-geolocation.md @@ -43,6 +43,7 @@ yarn add @react-native-oh-tpl/geolocation ```js import Geolocation from "@react-native-community/geolocation"; import { Button } from "react-native"; +import React from 'react'; export function GeolocationDemo(): JSX.Element { const tap = () => { diff --git a/zh-cn/react-native-drag-sort.md b/zh-cn/react-native-drag-sort.md index 121293c0aca05a867c9ceb8ac59227ac34f0556b..d57d58ebfb6fb81d9a0057884efc82bbe8bbe7cf 100644 --- a/zh-cn/react-native-drag-sort.md +++ b/zh-cn/react-native-drag-sort.md @@ -300,10 +300,16 @@ const bottomViewHeight = 40; const getW = (index, isWidth) => isWidth ? (index % 3 === 0 ? width - 40 : (width - 60) / 2) : 80; -export default class AnySizeDragSortDemo extends React.Component { +type State = { + items: { text: string, width: number, height: number }[]; + movedKey: any +} + +export default class AnySizeDragSortDemo extends React.Component { + sortableViewRef: React.RefObject; constructor(props) { super(props); - const items = []; + const items:State["items"] = []; for (let i = 0; i < 26; i++) { items.push({ text: String.fromCharCode(65 + i),