created the new npm and react-native-textInputBox for learning purpose and try to run that multiply in the other Project getting the error
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 30/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript, react-native, typescript
调研方向
首先,使用 multiply 导入复现已发布的 react-native-textinputbox 0.1.0 示例,并检查 lib/commonjs/index.js 以及 lib/typescript/module/src/index.d.ts。先检查生成的 package 和 native module 注册;当 multiply 能够在没有 Textinputbox 错误的情况下运行,并且 TypeScript 能够根据报告的 module 设置解析声明文件时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
I created a new npm package react-native-textinputbox for learning purposes using the create-react-native-library tool. After publishing the library, I tried using it in another project and encountered an issue when calling the multiply function from the library. I'm seeing the following error:
Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'Textinputbox' could not be found. Verify that a module by this name is registered in the native binary.
Could not find a declaration file for module 'react-native-textinputbox'. '.../node_modules/react-native-textinputbox/lib/commonjs/index.js' implicitly has an 'any' type.
There are types at '.../node_modules/react-native-textinputbox/lib/typescript/module/src/index.d.ts', but this result could not be resolved under your current 'moduleResolution' setting.
there is not typeScript Support as well
Steps to Reproduce:
Create a new npm package react-native-textinputbox using create-react-native-library.
Publish the package to npm.
Install the package in another React Native project.
Import the multiply function from react-native-textinputbox:
javascript
Copy code
import { multiply } from 'react-native-textinputbox';
Call the multiply function like so:
javascript
Copy code
const result = multiply(3, 7);
console.log(result);
Run the app and observe the errors.
Expected Behavior: The multiply function should work as expected without throwing errors, and the TypeScript declaration files should resolve correctly.
Environment:
react-native-textinputbox: 0.1.0
React Native: 0.76.5
TypeScript: 0.76.5
Expo (if applicable): 2.0.53
Possible Solution:
the default example should work as normal comes with the code and not ts support.
it should have the ts support.
- 主要语言
- JavaScript
- 星标
- 13.2k
- 派生
- 1.3k
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
expo/create-react-native-app 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 35/100
expo/create-react-native-app#947 ·
-
难度 4/5 3-5 天 新手友好度 10/100
expo/create-react-native-app#946 ·
-
难度 4/5 3-5 天 新手友好度 20/100
expo/create-react-native-app#931 · 14 条评论 ·
-
难度 3/5 1-2 天 新手友好度 25/100
expo/create-react-native-app#929 ·
-
难度 4/5 3-5 天 新手友好度 32/100
expo/create-react-native-app#927 · 2 条评论 · 1 个 reaction ·
查看 expo/create-react-native-app 的全部 Issue
相似的 Issue
-
bug data-types
难度 2/5 1-3 小时 新手友好度 88/100
ClickHouse/clickhouse-js#1293 ·
维护者通常 1 天内回复
-
area: tests help wanted size/s
难度 2/5 1-3 小时 新手友好度 92/100
DahanItamar/DockNest#368 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
-
good first issue
难度 2/5 1-3 小时 新手友好度 76/100