elastic / elastic/eui

[EuiTreeView] Migrate from class to function component

Open
#9,496 3 comments 0 reactions 0 assignees View on GitHub
help wanted low hanging fruit
Dominant language
TypeScript
Stars
6.4k
Forks
911
Avg merge
2d 11h
Merged PRs (30d)
65

Description

`EuiTreeView` renders a hierarchical tree with expandable nodes, keyboard navigation, and ARIA tree semantics.

- **File:** `components/tree_view/tree_view.tsx`
- **Class size:** 254 lines
- **State:** `openItems`, `activeItem`, `treeID`, `expandChildNodes`
- **Lifecycle:** `componentDidUpdate`

**Migration notes:**

Recursive rendering pattern with multiple state fields. `componentDidUpdate` manages expand-all behavior. Wrapped with `withEuiTheme`.

**Acceptance criteria:**

- [ ] Convert to function component with hooks
- [ ] Replace `withEuiTheme` with `useEuiTheme`
- [ ] Maintain keyboard navigation and ARIA tree semantics
- [ ] All existing tests pass

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.