Closed Bug 1849882 Opened 1 year ago Closed 1 year ago

LanguageSwitcher.jsx: ESLint warnings of React Hook useEffect has missing dependencies

Categories

(Firefox :: Messaging System, task, P3)

task

Tracking

()

RESOLVED FIXED
119 Branch
Iteration:
118.2 - Aug 14 - Aug 25
Tracking Status
firefox119 --- fixed

People

(Reporter: standard8, Assigned: Mardak)

References

Details

Attachments

(1 file)

When we turn on ESLint warnings on LanguageSwitcher.jsx, we see various warnings being referenced:

./mach eslint --warnings browser/components/newtab/content-src/aboutwelcome/components/LanguageSwitcher.jsx
  113:5  warning  React Hook useEffect has a missing dependency: 'screen'. Either include it or remove the dependency array.                                                                                                                                                                                                                                       react-hooks/exhaustive-deps (eslint)
  137:5  warning  React Hook useEffect has missing dependencies: 'appAndSystemLocaleInfo?.matchType', 'languageMismatchScreenIndex', 'screen', 'screenIndex', and 'setScreenIndex'. Either include them or remove the dependency array. If 'setScreenIndex' changes too often, find the parent component that defines it and wrap that definition in useCallback.  react-hooks/exhaustive-deps (eslint)
  175:6  warning  React Hook useEffect has missing dependencies: 'handleAction' and 'negotiatedLanguage.requestSystemLocales'. Either include them or remove the dependency array.                                                                                                                                                                                 react-hooks/exhaustive-deps (eslint)

I'm not sure if these should be added or excluded. I would like to make this rule into an error so that we can be sure these are addressed.

Ed, I think you added most of these, can you take a look please?

Flags: needinfo?(edilee)
Assignee: nobody → edilee
Status: NEW → ASSIGNED
Attachment #9350255 - Attachment description: Bug 1849882 - Add more useEffect dependencies to language switcher r?emcminn → Bug 1849882 - Add more useEffect dependencies to language switcher r=emcminn
Iteration: --- → 118.2 - Aug 14 - Aug 25
Component: New Tab Page → Messaging System
Flags: needinfo?(edilee)
Priority: -- → P3
Pushed by elee@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a8e7a9611e91 Add more useEffect dependencies to language switcher r=emcminn
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 119 Branch
Blocks: 1851452
Regressions: 1873019
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: