question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
NMinhNguyencommented, Dec 21, 2020

@pedroct92 would this work for your app perhaps? https://github.com/ds300/patch-package

0reactions
pedroct92commented, Dec 21, 2020

Hi @all,

I have been experiencing the same issue on our application that uses 4.11.1 I have compared with 4.11.2 but this fix was merged on the 5.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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found