elastic / elastic/eui

[EuiInMemoryTable] Migrate from class to function component

Open
#9,491 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
6.4k
Forks
911
Avg merge
2d 11h
Merged PRs (30d)
65

Description

`EuiInMemoryTable` extends `EuiBasicTable` with client-side sorting, pagination, and search. Highlighted as widely used.

- **File:** `components/basic_table/in_memory_table.tsx`
- **Class size:** 295 lines
- **State:** `prevProps`, `search`, `query`, `pageIndex`, `pageSize`, `pageSizeOptions`, `sortName`, `sortDirection`, `allowNeutralSort`, `showPerPageOptions`
- **Lifecycle:** `getDerivedStateFromProps`

**Migration notes:**

10+ state fields with `getDerivedStateFromProps` syncing pagination/sort from props. Should be migrated after `EuiBasicTable`. The derived state pattern is extensive and needs careful conversion.

**Acceptance criteria:**

- [ ] Convert to function component with hooks
- [ ] Migrate after `EuiBasicTable`
- [ ] Handle `getDerivedStateFromProps` → state sync for all 10+ fields
- [ ] 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.