1"use strict";(self.webpackChunkreact_native_website=self.webpackChunkreact_native_website||[]).push([["1360"],{50871(e,n,i){i.r(n),i.d(n,{metadata:()=>c,default:()=>h,frontMatter:()=>r,contentTitle:()=>d,toc:()=>a,assets:()=>l});var c=JSON.parse('{"id":"strict-typescript-api","title":"\u4E25\u683C TypeScript API\uFF08\u53EF\u9009\u52A0\u5165\uFF09","description":"\u4E25\u683C TypeScript API \u662F\u6211\u4EEC\u672A\u6765\u7A33\u5B9A\u7684 React Native JavaScript API \u7684\u9884\u89C8\u7248\u3002","source":"@site/versioned_docs/version-0.83/strict-typescript-api.md","sourceDirName":".","slug":"/strict-typescript-api","permalink":"/docs/0.83/strict-typescript-api","draft":false,"unlisted":false,"editUrl":"https://github.com/reactnativecn/react-native-website/blob/production/cnwebsite/../cndocs/strict-typescript-api.md","tags":[],"version":"0.83","frontMatter":{"id":"strict-typescript-api","title":"\u4E25\u683C TypeScript API\uFF08\u53EF\u9009\u52A0\u5165\uFF09"},"sidebar":"docs","previous":{"title":"\u4F7F\u7528 TypeScript","permalink":"/docs/0.83/typescript"},"next":{"title":"\u66F4\u65B0","permalink":"/docs/0.83/upgrading"}}'),t=i(62540),s=i(43023);let r={id:"strict-typescript-api",title:"\u4E25\u683C TypeScript API\uFF08\u53EF\u9009\u52A0\u5165\uFF09"},d,l={},a=[{value:"\u9009\u62E9\u52A0\u5165",id:"\u9009\u62E9\u52A0\u5165",level:2},{value:"\u8FC1\u79FB\u6307\u5357",id:"\u8FC1\u79FB\u6307\u5357",level:2},{value:"Codegen \u7C7B\u578B\u73B0\u5728\u5E94\u4ECE <code>react-native</code> \u5305\u4E2D\u5BFC\u5165",id:"codegen-\u7C7B\u578B\u73B0\u5728\u5E94\u4ECE-react-native-\u5305\u4E2D\u5BFC\u5165",level:3},{value:"\u79FB\u9664 <code>*Static</code> \u7C7B\u578B",id:"\u79FB\u9664-static-\u7C7B\u578B",level:3},{value:"\u4E00\u4E9B\u6838\u5FC3\u7EC4\u4EF6\u73B0\u5728\u662F\u51FD\u6570\u7EC4\u4EF6\u800C\u4E0D\u662F\u7C7B\u7EC4\u4EF6",id:"\u4E00\u4E9B\u6838\u5FC3\u7EC4\u4EF6\u73B0\u5728\u662F\u51FD\u6570\u7EC4\u4EF6\u800C\u4E0D\u662F\u7C7B\u7EC4\u4EF6",level:3},{value:"\u5176\u4ED6\u7834\u574F\u6027\u66F4\u6539",id:"\u5176\u4ED6\u7834\u574F\u6027\u66F4\u6539",level:2},{value:"Animated \u7C7B\u578B\u7684\u53D8\u5316",id:"animated-\u7C7B\u578B\u7684\u53D8\u5316",level:3},{value:"\u53EF\u9009\u5C5E\u6027\u7684\u7EDF\u4E00\u7C7B\u578B",id:"\u53EF\u9009\u5C5E\u6027\u7684\u7EDF\u4E00\u7C7B\u578B",level:3},{value:"\u79FB\u9664\u4E00\u4E9B\u5DF2\u5E9F\u5F03\u7684\u7C7B\u578B",id:"\u79FB\u9664\u4E00\u4E9B\u5DF2\u5E9F\u5F03\u7684\u7C7B\u578B",level:3},{value:"\u79FB\u9664\u5269\u4F59\u7684\u7EC4\u4EF6\u5C5E\u6027",id:"\u79FB\u9664\u5269\u4F59\u7684\u7EC4\u4EF6\u5C5E\u6027",level:3},{value:"\u4E4B\u524D\u53EF\u8BBF\u95EE\u7684\u79C1\u6709\u7C7B\u578B\u5E2E\u52A9\u5668\u73B0\u5728\u53EF\u80FD\u88AB\u79FB\u9664",id:"\u4E4B\u524D\u53EF\u8BBF\u95EE\u7684\u79C1\u6709\u7C7B\u578B\u5E2E\u52A9\u5668\u73B0\u5728\u53EF\u80FD\u88AB\u79FB\u9664",level:3}];function o(e){let n={a:"a",code:"code",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.p,{children:"\u4E25\u683C TypeScript API \u662F\u6211\u4EEC\u672A\u6765\u7A33\u5B9A\u7684 React Native JavaScript API \u7684\u9884\u89C8\u7248\u3002"}),"\n",(0,t.jsxs)(n.p,{children:["\u5177\u4F53\u6765\u8BF4\uFF0C\u8FD9\u662F ",(0,t.jsx)(n.code,{children:"react-native"})," npm \u5305\u7684\u4E00\u5957\u65B0\u7684 TypeScript \u7C7B\u578B\uFF0C\u4ECE 0.80 \u7248\u672C\u5F00\u59CB\u63D0\u4F9B\u3002\u8FD9\u4E9B\u7C7B\u578B\u63D0\u4F9B\u4E86\u66F4\u5F3A\u5927\u3001\u66F4\u9762\u5411\u672A\u6765\u7684\u7C7B\u578B\u51C6\u786E\u6027\uFF0C\u5E76\u5C06\u5141\u8BB8\u6211\u4EEC\u81EA\u4FE1\u5730\u5C06 React Native \u7684 API \u6F14\u8FDB\u4E3A\u7A33\u5B9A\u7684\u5F62\u72B6\u3002\u9009\u62E9\u52A0\u5165\u4E25\u683C TypeScript API \u4F1A\u5E26\u6765\u4E00\u4E9B\u7ED3\u6784\u6027\u7C7B\u578B\u5DEE\u5F02\uFF0C\u56E0\u6B64\u8FD9\u662F\u4E00\u6B21\u6027\u7684\u7834\u574F\u6027\u66F4\u6539\u3002"]}
1),"\n",(0,t.jsx)(n.p,{children:"\u65B0\u7C7B\u578B\u5177\u6709\u4EE5\u4E0B\u7279\u70B9\uFF1A"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"\u76F4\u63A5\u4ECE\u6211\u4EEC\u7684\u6E90\u4EE3\u7801\u751F\u6210"})," \u2014 \u63D0\u9AD8\u8986\u76D6\u7387\u548C\u6B63\u786E\u6027\uFF0C\u56E0\u6B64\u4F60\u53EF\u4EE5\u671F\u5F85\u66F4\u5F3A\u7684\u517C\u5BB9\u6027\u4FDD\u8BC1\u3002"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsxs)(n.strong,{children:["\u9650\u5236\u5728 ",(0,t.jsx)(n.code,{children:"react-native"})," \u7684\u7D22\u5F15\u6587\u4EF6\u4E2D"]})," \u2014 \u66F4\u4E25\u683C\u5730\u5B9A\u4E49\u6211\u4EEC\u7684\u516C\u5171 API\uFF0C\u610F\u5473\u7740\u6211\u4EEC\u5728\u8FDB\u884C\u5185\u90E8\u6587\u4EF6\u66F4\u6539\u65F6\u4E0D\u4F1A\u7834\u574F API\u3002"]}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"\u5F53\u793E\u533A\u51C6\u5907\u597D\u65F6\uFF0C\u4E25\u683C TypeScript API \u5C06\u5728\u672A\u6765\u6210\u4E3A\u6211\u4EEC\u7684\u9ED8\u8BA4 API \u2014 \u4E0E\u6DF1\u5EA6\u5BFC\u5165\u79FB\u9
1664\u540C\u6B65\u3002"}),"\n",(0,t.jsx)(n.h2,{id:"\u9009\u62E9\u52A0\u5165",children:"\u9009\u62E9\u52A0\u5165"}),"\n",(0,t.jsxs)(n.p,{children:["\u6211\u4EEC\u5C06\u8FD9\u4E9B\u65B0\u7C7B\u578B\u4E0E\u73B0\u6709\u7C7B\u578B\u4E00\u8D77\u53D1\u5E03\uFF0C\u8FD9\u610F\u5473\u7740\u4F60\u53EF\u4EE5\u5728\u51C6\u5907\u597D\u65F6\u9009\u62E9\u8FC1\u79FB\u3002\u6211\u4EEC\u9F13\u52B1\u65E9\u671F\u91C7\u7528\u8005\u548C\u65B0\u521B\u5EFA\u7684\u5E94\u7528\u901A\u8FC7 ",(0,t.jsx)(n.code,{children:"tsconfig.json"})," \u6587\u4EF6\u9009\u62E9\u52A0\u5165\u3002"]}),"\n",(0,t.jsxs)(n.p,{children:["\u9009\u62E9\u52A0\u5165\u662F\u4E00\u4E2A",(0,t.jsx)(n.strong,{children:"\u7834\u574F\u6027\u66F4\u6539"}),"\uFF0C\u56E0\u4E3A\u6211\u4EEC\u7684\u4E00\u4E9B\u65B0\u7C7B\u578B\u5177\u6709\u66F4\u65B0\u7684\u540D\u79F0\u548C\u7ED3\u6784\uFF0C\u5C3D\u7BA1\u8BB8\u591A\u5E94\u7528\u4E0D\u4F1A\u53D7\u5230\u5F71\u54CD\u3002\u4F60\u53EF\u4EE5\u5728\u4E0B\u4E00\u8282\u4E2D\u4E86\u89E3\u6BCF\u4E2A\u7834\u574F\u6027\u66F4\u6539\u3002"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-json",metastring:'title="tsconfig.json"',children:'{\n "extends": "@react-native/typescript-config",\n "compilerOptions": {\n ...\n "customConditions": ["react-native-strict-api"]\n }\n}\n'})}),"\n",(0,t.jsx)(n.p,{children:":::note \u5E95\u5C42\u539F\u7406"}),"\n",(0,t.jsxs)(n.p,{children:["\u8FD9\u5C06\u6307\u793A TypeScript \u4ECE\u6211\u4EEC\u65B0\u7684 ",(0,t.jsx)(n.a,{href:"https://www.npmjs.com/package/react-native?activeTab=code",children:(0,t.jsx)(n.code,{children:"types_generated/"})})," \u76EE\u5F55\u89E3\u6790 ",(0,t.jsx)(n.code,{children:"react-native"})," \u7C7B\u578B\uFF0C\u800C\u4E0D\u662F\u4E4B\u524D\u7684 ",(0,t.jsx)(n.a,{href:"https://www.npmjs.com/package/react-native?activeTab=code",children:(0,t.jsx)(n.code,{children:"types/"})})," \u76EE\u5F55\uFF08\u624B\u52A8\u7EF4\u62A4\uFF09\u3002\u4E0D\u9700\u8981\u91CD\u542F TypeScript \u6216\u4F60\u7684\u7F16\u8F91\u5668\u3002"]}),"\n",(0,t.jsx)(n.p,{children:":::"}),"\n",(0,t.jsxs)(n.p,{children:["\u4E25\u683C TypeScript API \u9075\u5FAA\u6211\u4EEC\u7684 ",(0,t.jsx)(n.a,{href:"https://github.com/react-native-community/discussions-and-proposals/pull/894",children:"RFC"})," \u6765\u79FB\u9664 React Native \u4E2D\u7684\u6DF1\u5EA6\u5BFC\u5165\u3002\u56E0\u6B64\uFF0C\u4E00\u4E9B API \u4E0D\u518D\u5728\u6839\u76EE\u5F55\u4E2D\u5BFC\u51FA\u3002\u8FD9\u662F\u6709\u610F\u7684\uFF0C\u76EE\u7684\u662F\u51CF\u5C11 React Native API \u7684\u6574\u4F53\u8868\u9762\u79EF\u3002"]}),"\n",(0,t.jsx)(n.p,{children:":::tip API \u53CD\u9988"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"\u53D1\u9001\u53CD\u9988"}),"\uFF1A\u6211\u4EEC\u5C06\u4E0E\u793E\u533A\u5408\u4F5C\uFF0C\u5728\uFF08\u81F3\u5C11\uFF09\u63A5\u4E0B\u6765\u7684\u4E24\u4E2A React Native \u7248\u672C\u4E2D\u786E\u5B9A\u6211\u4EEC\u5BFC\u51FA\u54EA\u4E9B API\u3002\u8BF7\u5728\u6211\u4EEC\u7684",(0,t.jsx)(n.a,{href:"https://github.com/react-native-community/discussions-and-proposals/discussions/893",children:"\u53CD\u9988\u7EBF\u7A0B"}),"\u4E2D\u5206\u4EAB\u4F60\u7684\u53CD\u9988\u3002"]}),"\n",(0,t.jsxs)(n.p,{children:["\u53C2\u89C1\u6211\u4EEC\u7684",(0,t.jsx)(n.a,{href:"/blog/2025/06/12/moving-towards-a-stable-javascript-api",children:"\u516C\u544A\u535A\u5BA2\u6587\u7AE0"}),"\uFF0C\u4E86\u89E3\u66F4\u591A\u5173\u4E8E\u6211\u4EEC\u52A8\u673A\u548C\u65F6\u95F4\u8868\u7684\u4FE1\u606F\u3002"]}),"\n",(0,t.jsx)(n.p,{children:":::"}),"\n",(0,t.jsx)(n.h2,{id:"\u8FC1\u79FB\u6307\u5357",children:"\u8FC1\u79FB\u6307\u5357"}),"\n",(0,t.jsxs)(n.h3,{id:"codegen-\u7C7B\u578B\u73B0\u5728\u5E94\u4ECE-react-native-\u5305\u4E2D\u5BFC\u5165",children:["Codegen \u7C7B\u578B\u73B0\u5728\u5E94\u4ECE ",(0,t.jsx)(n.code,{children:"react-native"})," \u5305\u4E2D\u5BFC\u5165"]}),"\n",(0,t.jsxs)(n.p,{children:["\u7528\u4E8E codegen \u7684\u7C7B\u578B\uFF0C\u5982 ",(0,t.jsx)(n.code,{children:"Int32"}),"\u3001",(0,t.jsx)(n.code,{children:"Double"}),"\u3001",(0,t.jsx)(n.code,{children:"WithDefault"})," \u7B49\uFF0C\u73B0\u5728\u5728\u5355\u4E2A ",(0,t.jsx)(n.code,{children:"CodegenTypes"})," \u547D\u540D\u7A7A\u95F4\u4E0B\u53EF\u7528\u3002\u540C\u6837\uFF0C",(0,t.jsx)(n.code,{children:"codegenNativeComponent"})," \u548C ",(0,t.jsx)(n.code,{children:"codegenNativeCommands"})," \u73B0\u5728\u53EF\u4EE5\u4ECE react-native \u5305\u4E2D\u5BFC\u5165\uFF0C\u800C\u4E0D\u9700\u8981\u4F7F\u7528\u6DF1\u5EA6\u5BFC\u5165\u3002"]}),"\n",(0,t.jsxs)(n.p,{children:["\u5F53\u672A\u542F\u7528\u4E25\u683C API \u65F6\uFF0C\u547D\u540D\u7A7A\u95F4 ",(0,t.jsx)(n.code,{children:"CodegenTypes"})," \u4EE5\u53CA ",(0,t.jsx)(n.code,{children:"codegenNativeCommands"})," \u548C ",(0,t.jsx)(n.code,{children:"codegenNativeComponent"})," \u4E5F\u53EF\u4EE5\u4ECE ",(0,t.jsx)(n.code,{children:"react-native"})," \u5305\u4E2D\u83B7\u53D6\uFF0C\u4EE5\u4FBF\u7B2C\u4E09\u65B9\u5E93\u66F4\u5BB9\u6613\u91C7\u7528\u3002"]}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.strong,{children:"\u4E4B\u524D"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",metastring:'title=""',children:"import
1codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';\nimport type {\n Int32,\n WithDefault,\n} from 'react-native/Libraries/Types/CodegenTypes';\n\ninterface NativeProps extends ViewProps {\n enabled?: WithDefault<boolean, true>;\n size?: Int32;\n}\n\nexport default codegenNativeComponent<NativeProps>(\n 'RNCustomComponent',\n);\n"})}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.strong,{children:"\u4E4B\u540E"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",metastring:'title=""',children:"import {CodegenTypes, codegenNativeComponent} from 'react-native';\n\ninterface NativeProps extends ViewProps {\n enabled?: CodegenTypes.WithDefault<boolean, true>;\n size?: CodegenTypes.Int32;\n}\n\nexport default codegenNativeComponent<NativeProps>(\n 'RNCustomComponent',\n);\n"})}),"\n",(0,t.jsxs)(n.h3,{id:"\u79FB\u9664-static-\u7C7B\u578B",children:["\u79FB\u9664 ",(0,t.jsx)(n.code,{children:"*Static"})," \u7C7B\u578B"]}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.strong,{children:"\u4E4B\u524D"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",metastring:'title=""',children:"import {Linking, LinkingStatic} from 'react-native';\n\nfunction foo(linking: LinkingStatic) {}\nfoo(Linking);\n"})}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.strong,{children:"\u4E4B\u540E"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",metastring:'title=""',children:"import {Linking} from 'react-native';\n\nfunction foo(linking: Linking) {}\nfoo(Linking);\n"})}),"\n",(0,t.jsxs)(n.p,{children:["\u4EE5\u4E0B API \u4E4B\u524D\u88AB\u547D\u540D\u4E3A ",(0,t.jsx)(n.code,{children:"*Static"})," \u52A0\u4E0A\u8BE5\u7C7B\u578B\u7684\u53D8\u91CF\u58F0\u660E\u3002\u5728\u5927\u591A\u6570\u60C5\u51B5\u4E0B\uFF0C\u6709\u4E00\u4E2A\u522B\u540D\uFF0C\u4F7F\u5F97\u503C\u548C\u7C7B\u578B\u5728\u76F8\u540C\u7684\u6807\u8BC6\u7B26\u4E0B\u5BFC\u51FA\uFF0C\u4F46\u6709\u4E9B\u662F\u7F3A\u5931\u7684\u3002"]}),"\n",(0,t.jsxs)(n.p,{children:["\uFF08\u4F8B\u5982\uFF0C\u6709\u4E00\u4E2A ",(0,t.jsx)(n.code,{children:"AlertStatic"})," \u7C7B\u578B\u3001\u7C7B\u578B\u4E3A ",(0,t.jsx)(n.code,{children:"AlertStatic"})," \u7684 ",(0,t.jsx)(n.code,{children:"Alert"})," \u53D8\u91CF\u548C\u4F5C\u4E3A ",(0,t.jsx)(n.code,{children:"AlertStatic"})," \u522B\u540D\u7684 ",(0,t.jsx)(n.code,{children:"Alert"})," \u7C7B\u578B\u3002\u4F46\u5728 ",(0,t.jsx)(n.code,{children:"PixelRatio"})," \u7684\u60C5\u51B5\u4E0B\uFF0C\u6709\u4E00\u4E2A ",(0,t.jsx)(n.code,{children:"PixelRatioStatic"})," \u7C7B\u578B\u548C\u8BE5\u7C7B\u578B\u7684 ",(0,t.jsx)(n.code,{children:"PixelRatio"})," \u53D8\u91CF\uFF0C\u4F46\u6CA1\u6709\u989D\u5916\u7684\u7C7B\u578B\u522B\u540D\u3002\uFF09"]}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.strong,{children:"\u53D7\u5F71\u54CD\u7684 API"})}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"AlertStatic"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"ActionSheetIOSStatic"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"ToastAndroidStatic"})}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"InteractionManagerStatic"})," (In this case there was no relevant ",(0,t.jsx)(n.code,{children:"InteractionManager"})," type alias)"]}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"UIManagerStatic"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"PlatformStatic"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"SectionListStatic"})}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"PixelRatioStatic"})," (In this case there was no relevant ",(0,t.jsx)(n.code,{children:"PixelRatio"})," type alias)"]}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"AppStateStatic"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"AccessibilityInfoStatic"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"ImageResizeModeStatic"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"BackHandlerStatic"})}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"DevMenuStatic"})," (In this case there was no relevant ",(0,t.jsx)(n.code,{children:"DevMenu"}
1)," type alias)"]}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"ClipboardStatic"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"PermissionsAndroidStatic"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"ShareStatic"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"DeviceEventEmitterStatic"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"LayoutAnimationStatic"})}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"KeyboardStatic"})," (In this case there was no relevant ",(0,t.jsx)(n.code,{children:"Keyboard"})," type alias)"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"DevSettingsStatic"})," (In this case there was no relevant ",(0,t.jsx)(n.code,{children:"DevSettings"})," type alias)"]}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"I18nManagerStatic"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"EasingStatic"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"PanResponderStatic"})}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"NativeModulesStatic"})," (In this case there was no relevant ",(0,t.jsx)(n.code,{children:"NativeModules"})," type alias)"]}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"LogBoxStatic"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"PushNotificationIOSStatic"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"SettingsStatic"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"VibrationStatic"})}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"\u4E00\u4E9B\u6838\u5FC3\u7EC4\u4EF6\u73B0\u5728\u662F\u51FD\u6570\u7EC4\u4EF6\u800C\u4E0D\u662F\u7C7B\u7EC4\u4EF6",children:"\u4E00\u4E9B\u6838\u5FC3\u7EC4\u4EF6\u73B0\u5728\u662F\u51FD\u6570\u7EC4\u4EF6\u800C\u4E0D\u662F\u7C7B\u7EC4\u4EF6"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"View"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"Image"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"TextInput"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"Modal"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"Text"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"TouchableWithoutFeedback"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"Switch"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"ActivityIndicator"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"ProgressBarAndroid"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"InputAccessoryView"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"Button"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"SafeAreaView"})}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["\u7531\u4E8E\u8FD9\u4E2A\u53D8\u5316\uFF0C\u8BBF\u95EE\u8FD9\u4E9B\u89C6\u56FE\u7684 ref \u7C7B\u578B\u9700\u8981\u4F7F\u7528 ",(0,t.jsx)(n.code,{children:"React.ComponentRef<typeof View>"})," \u6A21\u5F0F\uFF0C\u8FD9\u5BF9\u7C7B\u7EC4\u4EF6\u548C\u51FD\u6570\u7EC4\u4EF6\u90FD\u6309\u9884\u671F\u5DE5\u4F5C\uFF0C\u4F8B\u5982\uFF1A"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",metastring:'title=""',children:"const ref = useRef<React.ComponentRef<typeof View>>(null);\n"})}),"\n",(0,t.jsx)(n.h2,{id:"\u5176\u4ED6\u7834\u574F\u6027\u66F4\u6539",children:"\u5176\u4ED6\u7834\u574F\u6027\u66F4\u6539"}),"\n",(0,t.jsx)(n.h3,{id:"animated-\u7C7B\u578B\u7684\u53D8\u5316",children:"Animated \u7C7B\u578B\u7684\u53D8\u5316"}),"\n",(0,t.jsxs)(n.p,{children:["Animated \u8282\u70B9\u4E4B\u524D\u662F\u57FA\u4E8E\u5176\u63D2\u503C\u8F93\u51FA\u7684\u6CDB\u578B\u7C7B\u578B\u3002\u73B0\u5728\uFF0C\u5B83\u4EEC\u662F\u5177\u6709\u6CDB\u578B ",(0,t.jsx)(n.code,{children:"interpolate"})," \u65B9\u6CD5\u7684\u975E\u6CDB\u578B\u7C7B\u578B\u3002"]}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.code,{children:"Animated.LegacyRef"})," \u4E0D\u518D\u53EF\u7528\u3002"]}),"\n",(0,t.jsx)(n.h3,{id:"\u53EF\u9009\u5C5E\u6027\u7684\u7EDF\u4E00\u7C7B\u578B",children:"\u53EF\u9009\u5C5E\u6027\u7684\u7EDF\u4E00\u7C7B\u578B"}),"\n",(0,t.jsxs)(n.p,{children:["\u5728\u65B0\u7C7B\u578B\u4E2D\uFF0C\u6BCF\u4E2A\u53EF\u9009\u5C5E\u6027\u90FD\u5C06\u88AB\u7C7B\u578B\u5316\u4E3A ",(0,t.jsx)(n.code,{children:"type | undefined"}),"\u3002"]}
1),"\n",(0,t.jsx)(n.h3,{id:"\u79FB\u9664\u4E00\u4E9B\u5DF2\u5E9F\u5F03\u7684\u7C7B\u578B",children:"\u79FB\u9664\u4E00\u4E9B\u5DF2\u5E9F\u5F03\u7684\u7C7B\u578B"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://github.com/facebook/react-native/blob/0.80-stable/packages/react-native/types/public/DeprecatedPropertiesAlias.d.ts",children:(0,t.jsx)(n.code,{children:"DeprecatedPropertiesAlias.d.ts"})})," \u4E2D\u5217\u51FA\u7684\u6240\u6709\u7C7B\u578B\u5728\u4E25\u683C API \u4E0B\u90FD\u65E0\u6CD5\u8BBF\u95EE\u3002"]}),"\n",(0,t.jsx)(n.h3,{id:"\u79FB\u9664\u5269\u4F59\u7684\u7EC4\u4EF6\u5C5E\u6027",children:"\u79FB\u9664\u5269\u4F59\u7684\u7EC4\u4EF6\u5C5E\u6027"}),"\n",(0,t.jsxs)(n.p,{children:["\u4E00\u4E9B\u5728\u7C7B\u578B\u5B9A\u4E49\u4E2D\u5B9A\u4E49\u4F46\u7EC4\u4EF6\u672A\u4F7F\u7528\u6216\u7F3A\u5C11\u5B9A\u4E49\u7684\u5C5E\u6027\u88AB\u79FB\u9664\u4E86\uFF08\u4F8B\u5982\uFF1A",(0,t.jsx)(n.code,{children:"Text"})," \u4E0A\u7684 ",(0,t.jsx)(n.code,{children:"lineBreakMode"}),"\u3001",(0,t.jsx)(n.code,{children:"ScrollView"})," \u4E0A\u7684 ",(0,t.jsx)(n.code,{children:"scrollWithoutAnimationTo"}),"\u3001\u5728 transform \u6570\u7EC4\u5916\u5B9A\u4E49\u7684 transform \u6837\u5F0F\uFF09\u3002"]}),"\n",(0,t.jsx)(n.h3,{id:"\u4E4B\u524D\u53EF\u8BBF\u95EE\u7684\u79C1\u6709\u7C7B\u578B\u5E2E\u52A9\u5668\u73B0\u5728\u53EF\u80FD\u88AB\u79FB\u9664",children:"\u4E4B\u524D\u53EF\u8BBF\u95EE\u7684\u79C1\u6709\u7C7B\u578B\u5E2E\u52A9\u5668\u73B0\u5728\u53EF\u80FD\u88AB\u79FB\u9664"}),"\n",(0,t.jsxs)(n.p,{children:["\u7531\u4E8E\u4E4B\u524D\u7C7B\u578B\u5B9A\u4E49\u7684\u914D\u7F6E\uFF0C\u6BCF\u4E2A\u5B9A\u4E49\u7684\u7C7B\u578B\u90FD\u53EF\u4EE5\u4ECE ",(0,t.jsx)(n.code,{children:"react-native"})," \u5305\u4E2D\u8BBF\u95EE\u3002\u8FD9\u5305\u62EC\u6CA1\u6709\u663E\u5F0F\u5BFC\u51FA\u7684\u7C7B\u578B\u548C\u4EC5\u4F9B\u5185\u90E8\u4F7F\u7528\u7684\u5E2E\u52A9\u7C7B\u578B\u3002"]}),"\n",(0,t.jsxs)(n.p,{children:["\u8FD9\u65B9\u9762\u7684\u663E\u8457\u4F8B\u5B50\u662F\u4E0E StyleSheet \u76F8\u5173\u7684\u7C7B\u578B\uFF08\u5982 ",(0,t.jsx)(n.code,{children:"RecursiveArray"}),"\u3001",(0,t.jsx)(n.code,{children:"RegisteredStyle"})," \u548C ",(0,t.jsx)(n.code,{children:"Falsy"}),"\uFF09\u548C Animated \u76F8\u5173\u7684\u7C7B\u578B\uFF08\u5982 ",(0,t.jsx)(n.code,{children:"WithAnimatedArray"})," \u548C ",(0,t.jsx)(n.code,{children:"WithAnimatedObject"}),"\uFF09\u3002"]})]})}function h(e={}){let{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(o,{...e})}):o(e)}},43023(e,n,i){i.d(n,{R:()=>r,x:()=>d});var c=i(63696);let t={},s=c.createContext(t);function r(e){let n=c.useContext(s);return c.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:r(e.components),c.createElement(s.Provider,{value:n},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.