created the new npm and react-native-textInputBox for learning purpose and try to run that multiply in the other Project getting the error

Abierto
#945 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
30/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
javascript, react-native, typescript
Área
mobile, tooling

Línea de trabajo

Empieza reproduciendo el ejemplo publicado de react-native-textinputbox 0.1.0 con el import de multiply e inspeccionando lib/commonjs/index.js junto con lib/typescript/module/src/index.d.ts. Comprueba primero el paquete generado y el registro del módulo nativo; se considera hecho cuando multiply se ejecuta sin el error de Textinputbox y TypeScript resuelve el archivo de declaración con la configuración de módulos indicada.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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
Screenshot 2025-01-14 at 11 06 27 AM
Screenshot 2025-01-14 at 11 06 41 AM

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.

Lenguaje dominante
JavaScript
Estrellas
13.2k
Forks
1.3k
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de expo/create-react-native-app

Todos los issues de expo/create-react-native-app

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.