Open Sir-hennihau opened 4 years ago
+1
AFAIK none of collaborators use RN, so we dont know anything about that. If you are ready to make hooks RN-ready - we will be glad to see your PR.
It's only a matter to isolate browser API and expose module as UMD
Is there someone working on it? If not, I want to try :D
@italomlp it's all yours!
I've tried to use useTimeoutFn
and it complains about global window
and/or document
.
@sangdth to fix it temporarily you can import like this:
import useTimeoutFn from 'react-use/lib/useTimeoutFn';
@davidsonsns Does it work for useThrottleFn ?
Yeah @ScreamZ ! Tested right now and it's working.
import useThrottleFn from 'react-use/lib/useThrottleFn';
@sangdth to fix it temporarily you can import like this:
import useTimeoutFn from 'react-use/lib/useTimeoutFn';
I confirm this method works. Hope we will have better way to improve this.
@sangdth Any ideas how it could be improved?
For now, in my project, in order to avoid:
import useOne from 'react-use/lib/useOne';
import useTwo from 'react-use/lib/useTwo';
...
I have to make another helper, to
export {
useOne,
useTwo,
...
} from './customHooks';
I would like to import like that directly from react-use
.
This would be a really nice-to-have!
+1
Has there been any update on this issue? It would be wonderful to not have to manually import each and every function from the react-use/lib/*
directories.
+1
@italomlp as there's not any progress should we consider that you moved on? should i make a PR?
@italomlp as there's not any progress should we consider that you moved on? should i make a PR?
I think you can assume nobody has ever fixed this.
Switched to ahooks
and it works fine
import useThrottleFn from 'react-use/lib/useThrottleFn';
hi guys, this lib works, just have to use like this, or implement the treeshaking, if you do not implement de tree shaking it will compile all modules and there are some that probably only work on web, its mutch easier to post here the methods that are not currently wokring on react native
I only use effect methods like useMount, useUpdateEffect... so for me works great
react-dom peer dependency isn't also necessary for react-native any idea how to avoid it ?
Is React-Native supported? It does not seem so at the moment.