Repository: material-ui
Issue: [core] Fix eslint-plugin-react-compiler issues
Labels: core,ready to take

Part of https://github.com/mui/material-ui/issues/42548

As part of adopting the [official ESLint plugin for the React Compiler](https://react.dev/learn/react-compiler#installing-eslint-plugin-react-compiler), we want to solve all of the reported issues.

## Contributing

1. Pick a file (or group of files belonging to the same group, ideally) in the list of existing issues below and let us know in the comments so we can assign them to you. 
1. Enable `eslint-plugin-react-compiler` in your local setup.
  The plugin is disabled by default, you won't see issues reported by it unless you enable it manually. To enable it, go to the root `.eslintrc.js` file and set `ENABLE_REACT_COMPILER_PLUGIN` to `true`. You should start seeing the issues reported right into your IDE if it's configured to report ESLint errors.
1. Once the issue is solved, open a PR mentioning this issue so we can link it in the description and keep it up to date.

When in doubt if an issue can be solved or not (because of false positives or any other reason), explain why in your PR so we can discuss if the ESLint should be silenced in that case.

## Issues to fix

Here's the list of files containing issues reported by `eslint-plugin-react-compiler` (as of June 6th 2024).

### mui-material

#### Demos

- [x] docs/data/material/components/steppers/HorizontalNonLinearStepper.tsx ([#42559](https://github.com/mui/material-ui/pull/42559))
- [x] docs/data/material/components/use-media-query/UseWidth.tsx

#### Components / hooks ([#43117](https://github.com/mui/material-ui/pull/43117), [#43946](https://github.com/mui/material-ui/pull/43946))

- [x] packages/mui-material/src/Backdrop/Backdrop.js
- [ ] packages/mui-material/src/ButtonBase/ButtonBase.js
- [x] packages/mui-material/src/FormControl/FormControl.js
- [x] packages/mui-material/src/Hidden/withWidth.js
- [x] packages/mui-material/src/InputBase/InputBase.js
- [x] packages/mui-material/src/InputBase/InputBase.test.js
- [x] packages/mui-material/src/Popover/Popover.js
- [x] packages/mui-material/src/Select/SelectInput.js
- [x] packages/mui-material/src/Snackbar/Snackbar.test.js
- [x] packages/mui-material/src/SwipeableDrawer/SwipeableDrawer.js
- [x] packages/mui-material/src/Tooltip/Tooltip.js
- [x] packages/mui-material/src/styles/useTheme.js
- [x] packages/mui-material/src/usePagination/usePagination.test.js
- [x] packages/mui-material/src/useScrollTrigger/useScrollTrigger.js

### mui-lab ([#42880](https://github.com/mui/material-ui/pull/42880))

- [x] packages/mui-lab/src/Alert/Alert.js
- [x] packages/mui-lab/src/AlertTitle/AlertTitle.js
- [x] packages/mui-lab/src/Autocomplete/Autocomplete.js
- [x] packages/mui-lab/src/AvatarGroup/AvatarGroup.js
- [x] packages/mui-lab/src/Pagination/Pagination.js
- [x] packages/mui-lab/src/PaginationItem/PaginationItem.js
- [x] packages/mui-lab/src/Rating/Rating.js
- [x] packages/mui-lab/src/Skeleton/Skeleton.js
- [x] packages/mui-lab/src/SpeedDial/SpeedDial.js
- [x] packages/mui-lab/src/SpeedDialAction/SpeedDialAction.js
- [x] packages/mui-lab/src/SpeedDialIcon/SpeedDialIcon.js
- [x] packages/mui-lab/src/TabContext/TabContext.test.js
- [x] packages/mui-lab/src/ToggleButton/ToggleButton.js
- [x] packages/mui-lab/src/ToggleButtonGroup/ToggleButtonGroup.js

### mui-styles ([#43118](https://github.com/mui/material-ui/pull/43118))

- [x] packages/mui-styles/src/StylesProvider/StylesProvider.js
- [x] packages/mui-styles/src/makeStyles/makeStyles.js
- [x] packages/mui-styles/src/makeStyles/makeStyles.spec.tsx
- [x] packages/mui-styles/src/withStyles/withStyles.js

### mui-system ([#42637](https://github.com/mui/material-ui/pull/42637))

- [x] packages/mui-system/src/ThemeProvider/ThemeProvider.test.js

### mui-docs

- [ ] packages/mui-docs/src/CodeCopy/CodeCopy.tsx
- [x] packages/mui-docs/src/i18n/i18n.tsx ([#42881](https://github.com/mui/material-ui/pull/42881))

### mui-utils ([#43051](https://github.com/mui/material-ui/pull/43051))

- [x] packages/mui-utils/src/useControlled/useControlled.js
- [x] packages/mui-utils/src/useForkRef/useForkRef.ts
- [x] packages/mui-utils/src/useId/useId.ts
- [x] packages/mui-utils/src/useIsFocusVisible/useIsFocusVisible.ts
- [x] packages/mui-utils/src/useOnMount/useOnMount.ts

### mui-joy ([#42671](https://github.com/mui/material-ui/pull/42671))

- [x] packages/mui-joy/src/Checkbox/Checkbox.tsx
- [x] packages/mui-joy/src/FormControl/FormControl.tsx
- [x] packages/mui-joy/src/Input/Input.tsx
- [x] packages/mui-joy/src/Radio/Radio.tsx
- [x] packages/mui-joy/src/RadioGroup/RadioGroup.tsx
- [x] packages/mui-joy/src/Select/Select.tsx
- [x] packages/mui-joy/src/Switch/Switch.tsx
- [x] packages/mui-joy/src/Textarea/Textarea.tsx
- [x] packages/mui-joy/src/Tooltip/Tooltip.tsx
- [x] packages/mui-joy/src/styles/ThemeProvider.tsx
- [x] packages/mui-joy/src/styles/extendTheme.test.js

### Test ([#42626](https://github.com/mui/material-ui/pull/42626))

- [x] packages-internal/test-utils/src/mochaHooks.test.js
- [x] test/regressions/TestViewer.js

### mui-private-theming ([#42619](https://github.com/mui/material-ui/pull/42619))

- [x] packages/mui-private-theming/src/ThemeProvider/ThemeProvider.js
- [x] packages/mui-private-theming/src/useTheme/useTheme.js

### Documentation website components ([#42566](https://github.com/mui/material-ui/pull/42566))

- [x] docs/src/components/banner/AppFrameBanner.tsx
- [x] docs/src/components/productMaterial/MaterialStyling.tsx
- [x] docs/src/components/productX/XHero.tsx
- [x] docs/src/modules/components/ApiPage/sections/ToggleDisplayOption.tsx
- [x] docs/src/modules/components/AppNavDrawer.js
- [x] docs/src/modules/components/DemoSandbox.js
- [x] docs/src/modules/components/DemoToolbar.js
- [x] docs/src/modules/components/ReactRunner.tsx
- [x] docs/src/modules/components/ThemeContext.js


**Search keywords**: ESLint, React Compiler