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:
yarn add react-use
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.
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:yarn add react-use
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
aspeerDependencies
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 useuseCss
in the React Native application, I receive an error due to thenano-css
dependency, where there is a check for a global variable that does not exist in a mobile environment.A little about versions:
react-use
: v17.5.0