Skip to content

A rule to disallow inline functions in React? #4625

Answered by arendjr
VPKSoft asked this question in Q&A
Discussion options

You must be logged in to vote

I'm not aware of us having one, no.

I'm also not sure it would be a good idea. There are many situations where useCallback() doesn't add any value, such as when passing to a plain HTML element or a non-memoized component. Plus it would be difficult to avoid false negatives, for instance when we cannot trace the origin of a variable that is passed instead of a plain function.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@VPKSoft
Comment options

@dyc3
Comment options

dyc3 Nov 25, 2024
Maintainer

@lelelethu
Comment options

@dyc3
Comment options

dyc3 Dec 31, 2024
Maintainer

Answer selected by VPKSoft
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants