Skip to content

[EuiPortal] Migrate from class to function component #9456

Closed

Description

@weronikaolejniczak

EuiPortal is a utility component that renders children into a DOM node outside the parent hierarchy. It's used internally by every overlay component (popover, modal, flyout, tooltip).

  • File: components/portal/portal.tsx
  • Class size: 72 lines
  • State: portalNode: HTMLDivElement | null
  • Lifecycle: componentDidMount, componentWillUnmount

Migration notes:

Straightforward conversion. Mount/unmount logic maps directly to a useEffect cleanup pattern. State becomes useState. No getDerivedStateFromProps or performance-sensitive lifecycle.

Acceptance criteria:

  • Convert to function component with hooks (useState, useEffect)
  • Maintain identical DOM insertion/removal behavior
  • All existing tests pass
  • No regressions in components that depend on EuiPortal (modal, flyout, popover, tooltip)
  • Carefully smoke-tested with Kibana
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions