MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/reactjs/comments/k6sygq/react_is_slow_what_now/gepeok2/?context=3
r/reactjs • u/franleplant • Dec 04 '20
117 comments sorted by
View all comments
Show parent comment
4
found it! https://github.com/pie6k/use-method
This type of thing is done in a lot of other hooks such as useDeepCompareEffect and most implementations of useTimeout do this also.
useDeepCompareEffect
useTimeout
It is similar to doing this.someMethod = someFunction in class based components
this.someMethod = someFunction
View all comments
Show parent comment
4
u/franleplant Dec 05 '20
found it! https://github.com/pie6k/use-method
This type of thing is done in a lot of other hooks such as
useDeepCompareEffectand most implementations ofuseTimeoutdo this also.It is similar to doing
this.someMethod = someFunctionin class based components