rusackas opened a new pull request, #37902:
URL: https://github.com/apache/superset/pull/37902
## Summary
This PR converts all remaining React class components to function components
using hooks to satisfy the `react-prefer-function-component` ESLint rule.
### Key changes:
- **76 files modified** across dashboard, explore, SqlLab, Chart, and plugin
areas
- Converted class components using lifecycle methods to function components
with hooks:
- `useState` for state management
- `useCallback` for memoized callbacks
- `useEffect` for lifecycle methods (componentDidMount,
componentDidUpdate, componentWillUnmount)
- `useRef` for instance variables
- `useMemo` for computed values
- Updated associated test files with proper TypeScript typing
- Fixed JSX.Element return types for components used as JSX
- Added explicit ControlHeader props where needed
- Fixed shouldFocus callback signature in WithPopoverMenu usage
### Notable exceptions (not converted):
- **ErrorBoundary** - Uses `componentDidCatch` which has no hook equivalent
- **DragDroppable** - react-dnd's HOC system requires class instance
properties
## Test plan
- [x] Pre-commit prettier and eslint checks pass
- [ ] CI tests pass (TypeScript errors in CI are pre-existing, not from this
PR)
- [ ] Manual testing of dashboard, explore, and SqlLab areas
## Before/After
**Before:** Class components with lifecycle methods
**After:** Function components with hooks
---
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]