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.

[preact/debug] false positive complain about memoization

See original GitHub issue

Reproduction

Libraries:

  • preact 10.4.8

Steps to reproduce

Press here to see an example. Dynamic dependencies of memoized calculations through useMemo/useCallback result in a false positive complain about memoization.

Screen Shot 2020-09-19 at 5 13 31 AM

Expected Behavior

Dynamic dependencies shouldn’t result in a console’s complain.

Actual Behavior

False positive complain.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
marvinhagemeistercommented, Dec 17, 2020

Is there a way to turn this off in dev?

No.

Can I contribute a PR for resolving this?

Yes 👍

1reaction
marvinhagemeistercommented, Dec 17, 2020

@afzalsayed96 remove that check in preact/debug. My understanding is that linters can/should take care of that already and linter rules can be easily ignored on a case-by-case basis.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Memoization Forget-Me-Bomb. Remember it? No! - ITNEXT
That means that they are 1) not fast 2) not safe 3) could produce false positives — some different data could have the...
Read more >
You're overusing useMemo: Rethinking Hooks memoization
In some cases, useMemo is irrelevant, overused, and harmful to your application performance. Learn these situations and how to avoid them.
Read more >
Writing Resilient Components - Overreacted
Statically analyzing calls from componentDidMount and componentDidUpdate is fraught with false positives. However, one could design an API that ...
Read more >
The 10 Most Common JavaScript Issues Developers Face
Makes debugging easier. Code errors that would otherwise have been ignored or would have failed silently will now generate errors or throw exceptions,...
Read more >
What are your favorite interview questions for a senior React ...
I think instead of react-specific questions, system design questions make more sense ... that one generated a lot of false positives for me, ......
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