Migrate native spec imports to the public React Native API
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 58/100
- Issue 类型
- 重构
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- javascript, react-native
调研方向
Start with src/specs/DateTimePickerNativeComponent.js and compare its React Native imports with the public Codegen exports documented in the issue. Then inspect the remaining native module specifications for private React Native imports and check the supported React Native versions before deciding whether the minimum version needs to change. Done means the specifications use supported public imports with their existing annotations and defaults preserved, and the compatibility implications are addressed.
由索引模型根据 Issue 内容生成。
描述
Summary
@react-native-community/[email protected] uses private React Native imports in its native component specification. The current upstream specification still contains these imports.
React Native introduced its Strict TypeScript API in 0.80 and enabled it by default in 0.87. React Native documents public package-root exports for Codegen types and helpers as the supported migration path.
Affected imports
In src/specs/DateTimePickerNativeComponent.js:
import type {ViewProps} from 'react-native/Libraries/Components/View/ViewPropTypes';
import type {ColorValue} from 'react-native/Libraries/StyleSheet/StyleSheet';
import type {
BubblingEventHandler,
Double,
Int32,
WithDefault,
} from 'react-native/Libraries/Types/CodegenTypes';
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
Suggested change
Use the public package-root exports:
import type {ViewProps, ColorValue, HostComponent, CodegenTypes} from 'react-native';
import {codegenNativeComponent} from 'react-native';
Update the specification's numeric, event-handler, and default-value annotations to CodegenTypes.Double, CodegenTypes.Int32, CodegenTypes.BubblingEventHandler, and CodegenTypes.WithDefault, preserving their existing signatures and defaults.
Please check the remaining native module specifications for private React Native imports as part of this migration, and account for the library's supported React Native versions when deciding whether a minimum-version change is needed.
Scope and compatibility
- Library version: 9.1.0
- Target React Native version: 0.87.1
- Scope: native specification import migration, not a platform-specific picker runtime failure.
- This particular component specification is Flow source. This report does not claim that a normal TypeScript consumer necessarily typechecks this
.jsfile or fails merely by importing the library; it requests migration away from the private paths to the documented public API. - This report is based on source inspection. No standalone reproduction repository is attached.
References
- React Native Strict TypeScript API and Codegen migration guide
- Equivalent public-import migration proposed for react-native-safe-area-context
AI disclosure: GitHub Copilot assisted with researching and drafting this issue
- 主要语言
- JavaScript
- 星标
- 2.9k
- 派生
- 459
- 平均合并
- 4 天 16 小时
- 30 天内合并 PR
- 5
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
react-native-datetimepicker/datetimepicker 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
-
难度 3/5 1-2 天 新手友好度 52/100
-
难度 3/5 1-2 天 新手友好度 55/100
react-native-datetimepicker/datetimepicker#1047 · 6 条评论 ·
-
难度 4/5 3-5 天 新手友好度 20/100
react-native-datetimepicker/datetimepicker#1046 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 45/100
查看 react-native-datetimepicker/datetimepicker 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
microsoft/TypeScript#65370 ·
维护者通常 1 天内回复
-
enhancement good first issue priority: medium
难度 2/5 1-3 小时 新手友好度 82/100
TMHSDigital/Free-Game-Dev-Assets#272 ·
维护者通常 1 天内回复
-
metrics priority: medium
难度 1/5 1-3 小时 新手友好度 86/100
LearningCircuit/local-deep-research#8336 ·
维护者通常 1 天内回复
-
ace bug yaml
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
svelte: whitespace-only edit leaves an empty todo, edits not trimmed, filter not restored on reload未关闭
难度 2/5 1-3 小时 新手友好度 72/100