handleTabsScroll uses useCallback without passing arguments
See original GitHub issue- The issue is present in the latest release.
- I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯
debug.module.js:229 In ForwardRef(Tabs) you are calling useMemo/useCallback without passing arguments.
This is a noop since it will not be able to memoize, it will execute it every render.
also calling useEffect on line 349 of Tabs.js with no second argument as well.
Expected Behavior 🤔
Pass an additional second argument or remove the useCallback method as it creates an unnecessary wrapper.
Steps to Reproduce 🕹
Steps:
n/a
Context 🔦
Remove error messages.
Your Environment 🌎
Tech | Version |
---|---|
Material-UI | v4.9.7 |
Preact | 10.3.4 |
TypeScript | 3.7.5 |
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:9 (7 by maintainers)
Top Results From Across the Web
handleTabsScroll uses useCallback without passing arguments
The issue is present in the latest release. I have searched the issues of this repository and believe that this is not a...
Read more >React useCallback with Parameter - Stack Overflow
useCallback on a argument receiving HOF provides no value unless you also memoize the internal function within the useCallback usage. – ...
Read more >Your Guide to React.useCallback() - Dmitri Pavlutin
This reasoning is far from the truth. Such usage of useCallback() without profiling makes the component slower. In this post, I'm going to ......
Read more >How to Use useCallback Hook with TypeScript -- newline
The useCallback hook returns a memoized callback that only changes if one of the dependencies has changed. This helps us to avoid unwanted ......
Read more >Hooks API Reference - React
useCallback (fn, deps) is equivalent to useMemo(() => fn, deps) . Note. The array of dependencies is not passed as arguments to the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@pedroct92 would this work for your app perhaps? https://github.com/ds300/patch-package
Hi @all,
I have been experiencing the same issue on our application that uses
4.11.1
I have compared with4.11.2
but this fix was merged on the5.x.x
.I know you guys dont have bandwidth to backport the changes but I would be quite happy to contribute and do the changes.
Let me know what you guys think.