diff --git a/en/react-native-audio.md b/en/react-native-audio.md index 5269852bc79f9c394bdf56c90434c7174626a585..ab42d2426c7a0ffef590e05077045f55f467d031 100644 --- a/en/react-native-audio.md +++ b/en/react-native-audio.md @@ -43,6 +43,7 @@ import { SafeAreaView, StatusBar, Text, Button, TextInput, View, Switch, StyleSh import { AudioRecorder, AudioUtils } from 'react-native-audio'; type FileType = { + [key: string]: any, base64: string; duration: number; status: string; @@ -50,6 +51,15 @@ type FileType = { audioFileURL: string; } +interface ObjectDataType { + currentTime: number, + duration: number, + status: string, + audioFileSize: number, + audioFileURL: string, + base64: string, +} + export default () => { const [second, setSecond] = useState(0); const [file, setFile] = useState(); @@ -77,10 +87,10 @@ export default () => { MeasurementMode: false,//only ios IncludeBase64: true }) - AudioRecorder.onProgress = (data) => { + AudioRecorder.onProgress = (data: ObjectDataType) => { setSecond(data.currentTime); } - AudioRecorder.onFinished = (data) => { + AudioRecorder.onFinished = (data: ObjectDataType) => { const { duration, status, audioFileSize, audioFileURL } = data let str = data.base64.slice(0, 20); setFile({ base64: str + '...', duration, status, audioFileSize, audioFileURL }) @@ -154,7 +164,7 @@ export default () => { - {!!file.base64 && + {!!file?.base64 && 录音文件: {`audio_demo.m4a`} diff --git a/en/react-native-drawer-layout-polyfill.md b/en/react-native-drawer-layout-polyfill.md index c2d616cc35074a03841ea358219578135230e7db..5d297b13ac23491a04e8d9ff5e1baffe212ef62b 100644 --- a/en/react-native-drawer-layout-polyfill.md +++ b/en/react-native-drawer-layout-polyfill.md @@ -43,7 +43,7 @@ import { Button, Text, StyleSheet, View, TextInput } from "react-native"; import DrawerLayout from "react-native-drawer-layout-polyfill"; const App = () => { - const drawerLayoutRef = useRef(null); + const drawerLayoutRef = useRef<{ openDrawer: () => void, closeDrawer: () => void }>(null); const [drawerPosition, setDrawerPosition] = useState("left"); const [keyboardDismissMode, setKeyboardDismissMode] = useState("none"); const [drawerLockMode, setDrawerLockMode] = useState("unlocked "); @@ -86,27 +86,27 @@ const App = () => { } }; - const changeDrawerLockMode = (type) => { + const changeDrawerLockMode = (type: string) => { console.log("drawerLockMode-Modify the lock mode of the pop-up box", type); setDrawerLockMode(type); }; - const handleDrawerOpen = (e) => { + const handleDrawerOpen = (e: any) => { console.log("onDrawerOpen-Open the callback in the pop-up box"); setIsOpen("Open"); }; - const handleDrawerClose = (e) => { + const handleDrawerClose = (e: any) => { console.log("onDrawerClose-Turn off the bomb frame"); setIsOpen("closure"); }; - const handleDrawerSlide = (e) => { + const handleDrawerSlide = (e: any) => { console.log("onDrawerSlide-The callback function when navigation view occurs when interacting"); setDrawerSlideOutput(JSON.stringify(e.nativeEvent)); }; - const handleDrawerStateChanged = (e) => { + const handleDrawerStateChanged = (e: any) => { console.log("onDrawerStateChanged-The recovery function when the state of the navigation view changes"); setDrawerStateChangedOutput(JSON.stringify(e)); }; diff --git a/en/react-native-picker.md b/en/react-native-picker.md index 9826ddca0e26741f4f5ac52b4394cedaf3aba279..493b50918091aaa662c5f620184d805bce2139a2 100644 --- a/en/react-native-picker.md +++ b/en/react-native-picker.md @@ -308,4 +308,4 @@ Check the release version information in the release address of the third-party ## License -This project is licensed under [The MIT License (MIT)](https://mit-license.org/). +This project is licensed under [The MIT License (MIT)](https://github.com/react-native-oh-library/react-native-picker/blob/sig/LICENSE). diff --git a/en/react-native-popup-menu.md b/en/react-native-popup-menu.md index f631ff79244a0e591690dc850e287c42512d8894..c40b44002d64251811727c237b793aa3f7791269 100644 --- a/en/react-native-popup-menu.md +++ b/en/react-native-popup-menu.md @@ -40,7 +40,13 @@ The following code shows the basic use scenario of the repository: ```js // your entry point -import { MenuProvider } from "react-native-popup-menu"; +import { + MenuProvider, + Menu, + MenuOptions, + MenuOption, + MenuTrigger, +} from "react-native-popup-menu"; export const App = () => ( @@ -49,12 +55,6 @@ export const App = () => ( ); // somewhere in your app -import { - Menu, - MenuOptions, - MenuOption, - MenuTrigger, -} from "react-native-popup-menu"; import { Text, View, diff --git a/zh-cn/react-native-audio.md b/zh-cn/react-native-audio.md index 612eeb6f30adfec4b72a8824e370a7e9979a66ba..436b06443f3ab1ea4403aedc3c9c6c63b67125b1 100644 --- a/zh-cn/react-native-audio.md +++ b/zh-cn/react-native-audio.md @@ -43,6 +43,7 @@ import { SafeAreaView, StatusBar, Text, Button, TextInput, View, Switch, StyleSh import { AudioRecorder, AudioUtils } from 'react-native-audio'; type FileType = { + [key: string]: any, base64: string; duration: number; status: string; @@ -50,6 +51,15 @@ type FileType = { audioFileURL: string; } +interface ObjectDataType { + currentTime: number, + duration: number, + status: string, + audioFileSize: number, + audioFileURL: string, + base64: string, +} + export default () => { const [second, setSecond] = useState(0); const [file, setFile] = useState(); @@ -77,10 +87,10 @@ export default () => { MeasurementMode: false,//only ios IncludeBase64: true }) - AudioRecorder.onProgress = (data) => { + AudioRecorder.onProgress = (data: ObjectDataType) => { setSecond(data.currentTime); } - AudioRecorder.onFinished = (data) => { + AudioRecorder.onFinished = (data: ObjectDataType) => { const { duration, status, audioFileSize, audioFileURL } = data let str = data.base64.slice(0, 20); setFile({ base64: str + '...', duration, status, audioFileSize, audioFileURL }) @@ -154,7 +164,7 @@ export default () => { - {!!file.base64 && + {!!file?.base64 && 录音文件: {`audio_demo.m4a`} diff --git a/zh-cn/react-native-drawer-layout-polyfill.md b/zh-cn/react-native-drawer-layout-polyfill.md index aabb041455f05e4a71733095ebcb40b1dd203786..1b65faf2a57b3b8da9cc4d58ca513fbaec52da07 100644 --- a/zh-cn/react-native-drawer-layout-polyfill.md +++ b/zh-cn/react-native-drawer-layout-polyfill.md @@ -43,7 +43,7 @@ import { Button, Text, StyleSheet, View, TextInput } from "react-native"; import DrawerLayout from "react-native-drawer-layout-polyfill"; const App = () => { - const drawerLayoutRef = useRef(null); + const drawerLayoutRef = useRef<{ openDrawer: () => void, closeDrawer: () => void }>(null); const [drawerPosition, setDrawerPosition] = useState("left"); const [keyboardDismissMode, setKeyboardDismissMode] = useState("none"); const [drawerLockMode, setDrawerLockMode] = useState("unlocked "); @@ -86,27 +86,27 @@ const App = () => { } }; - const changeDrawerLockMode = (type) => { + const changeDrawerLockMode = (type: string) => { console.log("drawerLockMode-修改弹框锁定模式", type); setDrawerLockMode(type); }; - const handleDrawerOpen = (e) => { + const handleDrawerOpen = (e: any) => { console.log("onDrawerOpen-打开弹框的回调"); setIsOpen("打开"); }; - const handleDrawerClose = (e) => { + const handleDrawerClose = (e: any) => { console.log("onDrawerClose-关闭弹框的回调"); setIsOpen("关闭"); }; - const handleDrawerSlide = (e) => { + const handleDrawerSlide = (e: any) => { console.log("onDrawerSlide-导航视图发生交互时的回调函数"); setDrawerSlideOutput(JSON.stringify(e.nativeEvent)); }; - const handleDrawerStateChanged = (e) => { + const handleDrawerStateChanged = (e: any) => { console.log("onDrawerStateChanged-导航视图的状态发生变化时的回调函数"); setDrawerStateChangedOutput(JSON.stringify(e)); }; diff --git a/zh-cn/react-native-picker.md b/zh-cn/react-native-picker.md index 16c39bd6db6eefd6220119653b10c4fa8f6b75fa..31abd4605173a3ee7fb79120ce76cad457348d08 100644 --- a/zh-cn/react-native-picker.md +++ b/zh-cn/react-native-picker.md @@ -309,4 +309,4 @@ ohpm install ## 开源协议 -本项目基于 [The MIT License (MIT)](https://mit-license.org/) ,请自由地享受和参与开源。 \ No newline at end of file +本项目基于 [The MIT License (MIT)](https://github.com/react-native-oh-library/react-native-picker/blob/sig/LICENSE) ,请自由地享受和参与开源。 \ No newline at end of file diff --git a/zh-cn/react-native-popup-menu.md b/zh-cn/react-native-popup-menu.md index d6052b98f6d9aba3a9d7efe65348d7db84cd4f7b..8ad400202f3e6366ca570caa7746c6497f4a9739 100644 --- a/zh-cn/react-native-popup-menu.md +++ b/zh-cn/react-native-popup-menu.md @@ -40,7 +40,13 @@ yarn add react-native-popup-menu@0.16.1 ```js // your entry point -import { MenuProvider } from "react-native-popup-menu"; +import { + MenuProvider, + Menu, + MenuOptions, + MenuOption, + MenuTrigger, +} from "react-native-popup-menu"; export const App = () => ( @@ -49,12 +55,6 @@ export const App = () => ( ); // somewhere in your app -import { - Menu, - MenuOptions, - MenuOption, - MenuTrigger, -} from "react-native-popup-menu"; import { Text, View,