Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Change some dependencies to `peerDependencies` to use them in different applications

Abierto
#2,565 5 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
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
react, react-native, typescript
Área
frontend, mobile

Línea de trabajo

Inspect the package dependency declarations and the useCss entry point, especially its nano-css dependency. Reproduce the yarn add and yarn start steps in a React Native application; done means browser-only dependencies are optional and installing react-use no longer triggers the mobile-environment error.

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

Descripción

What is the current behavior?
I am currently receiving an error when using react-use in React Native applications.

Steps to reproduce it and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have extra dependencies other than react-use. Paste the link to your JSFiddle or CodeSandbox example below:

  1. yarn add react-use
  2. yarn start

What is the expected behavior?

It is expected that some hooks, which rely exclusively on the browser to run, should treat their dependencies as peerDependencies and make it optional to download them for use.

An example I can mention is useCss, which depends on nano-css. Even if I don't use useCss in the React Native application, I receive an error due to the nano-css dependency, where there is a check for a global variable that does not exist in a mobile environment.

A little about versions:

  • OS: macOs Sonoma v14.5
  • Browser (vendor and version):
  • React: v18.2.0
  • react-use: v17.5.0
  • Did this worked in the previous package version?
Lenguaje dominante
TypeScript
Estrellas
44k
Forks
3.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 streamich/react-use

Todos los issues de streamich/react-use

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.