-
-
Notifications
You must be signed in to change notification settings - Fork 495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 useExhaustiveDependencies error when useState is on a new line #168
Comments
Thank you for reporting. I opened the playground and I see a diagnostic on |
Yes the diagnostic error comes on useEffect, useMemo and useCallback but the culprit is that the useState is on a new line. on the second component the useState is in line |
@ematipico maybe this example is clearer, it has the same variables the only difference is line 5 and 6 vs line 18 const [stringContent, setStringContent] =
useState<SomeLongStringType>('Something'); const [stringContent, setStringContent] = useState<SomeLongStringType>('Something'); |
Environment information
What happened?
useExhaustiveDependencies marks incorrectly a useState function as a missing dependency when the useState statement is on the next line.
https://biomejs.dev/playground/?indentStyle=space"eStyle=single&jsxQuoteStyle=single&lintRules=all&code=aQBtAHAAbwByAHQAIAB7ACAAdQBzAGUAUwB0AGEAdABlACwAIAB1AHMAZQBFAGYAZgBlAGMAdAAgAH0AIABmAHIAbwBtACAAJwByAGUAYQBjAHQAJwA7AAoACgB0AHkAcABlACAAUwBvAG0AZQBMAG8AbgBnAFMAdAByAGkAbgBnAFQAeQBwAGUAIAA9ACAAcwB0AHIAaQBuAGcAOwAKAGUAeABwAG8AcgB0ACAAYwBvAG4AcwB0ACAAQwBvAG0AcABvAG4AZQBuAHQAIAA9ACAAKAApACAAPQA%2BACAAewAKACAAIABjAG8AbgBzAHQAIABbAHMAdAByAGkAbgBnAEMAbwBuAHQAZQBuAHQALAAgAHMAZQB0AFMAdAByAGkAbgBnAEMAbwBuAHQAZQBuAHQAXQAgAD0ACgAgACAAIAAgAHUAcwBlAFMAdABhAHQAZQA8AFMAbwBtAGUATABvAG4AZwBTAHQAcgBpAG4AZwBUAHkAcABlAD4AKAAnAFMAbwBtAGUAdABoAGkAbgBnACcAKQA7AAoACgAgACAAdQBzAGUARQBmAGYAZQBjAHQAKAAoACkAIAA9AD4AIAB7AAoAIAAgACAAIABzAGUAdABTAHQAcgBpAG4AZwBDAG8AbgB0AGUAbgB0ACgAKABjAG8AbgB0AGUAbgB0ACkAIAA9AD4AIAB7AAoAIAAgACAAIAAgACAAcgBlAHQAdQByAG4AIABgACQAewBjAG8AbgB0AGUAbgB0AH0AIABvAHQAaABlAHIAYAA7AAoAIAAgACAAIAB9ACkAOwAKACAAIAB9ACwAIABbAF0AKQA7AAoACgAgACAAcgBlAHQAdQByAG4AIABzAHQAcgBpAG4AZwBDAG8AbgB0AGUAbgB0ADsACgB9ADsACgAKAGUAeABwAG8AcgB0ACAAYwBvAG4AcwB0ACAATwB0AGgAZQByAEMAbwBtAHAAbwBuAGUAbgB0ACAAPQAgACgAKQAgAD0APgAgAHsACgAgACAAYwBvAG4AcwB0ACAAWwBzAHQAcgBpAG4AZwBDAG8AbgB0AGUAbgB0ACwAIABzAGUAdABTAHQAcgBpAG4AZwBdACAAPQAgAHUAcwBlAFMAdABhAHQAZQA8AHMAdAByAGkAbgBnAD4AKAAnAFMAbwBtAGUAdABoAGkAbgBnACcAKQA7AAoACgAgACAAdQBzAGUARQBmAGYAZQBjAHQAKAAoACkAIAA9AD4AIAB7AAoAIAAgACAAIABzAGUAdABTAHQAcgBpAG4AZwAoACgAYwBvAG4AdABlAG4AdAApACAAPQA%2BACAAewAKACAAIAAgACAAIAAgAHIAZQB0AHUAcgBuACAAYAAkAHsAYwBvAG4AdABlAG4AdAB9ACAAbwB0AGgAZQByAGAAOwAKACAAIAAgACAAfQApADsACgAgACAAfQAsACAAWwBdACkAOwAKAAoAIAAgAHIAZQB0AHUAcgBuACAAcwB0AHIAaQBuAGcAQwBvAG4AdABlAG4AdAA7AAoAfQA7AAoA
Expected result
No useExhaustiveDependencies error on useState functions
Code of Conduct
The text was updated successfully, but these errors were encountered: