REL1CX

Results 36 comments of REL1CX

> Another false positive for this rule is `BackHandler` from `react-native`. > > `BackHandler.addEventListener` returns a `remove` method, but the rules complains when it is used. @SuperKXT Thank you for...

I suggest enhancing the [no-unnecessary-use-callback](https://eslint-react.xyz/docs/rules/no-unnecessary-use-callback) rule to cover the case outlined in this issue, and updating the rule's docs to include new examples and explanations.

> > I suggest enhancing the [no-unnecessary-use-callback](https://eslint-react.xyz/docs/rules/no-unnecessary-use-callback) rule to cover the case outlined in this issue, and updating the rule's docs to include new examples and explanations. > > If...

> @Rel1cx I could do a PoC for that? @possum-enjoyer Yes, please go ahead. FYI: This is where I am currently writing the heuristic detection for object type value [packages/utilities/var/src/get-object-type.ts](https://github.com/Rel1cx/eslint-react/blob/4ad949e59a2b03e61cd6b0635931ade606b3503c/packages/utilities/var/src/get-object-type.ts),...

Until we find a better way to implement it that doesn't affect performance and increase code complexity much, I recommend the suggestion in https://github.com/antfu/eslint-config/issues/640#issuecomment-2546360635.

I believe for use cases similar to "didMount", there are better alternative patterns that avoid violating the `set-state-in-effect` rule, as shown below: ```tsx import { useEffect, useRef, useState, Fragment }...