Skip to content

[EuiWindowEvent] Refactor class component to functional component#9536

Open
barlima wants to merge 1 commit intoelastic:mainfrom
barlima:EuiWindowEvent/refactor-to-functional-component
Open

[EuiWindowEvent] Refactor class component to functional component#9536
barlima wants to merge 1 commit intoelastic:mainfrom
barlima:EuiWindowEvent/refactor-to-functional-component

Conversation

@barlima
Copy link
Copy Markdown
Contributor

@barlima barlima commented Mar 26, 2026

Summary

  • What: Refactored EuiWindowEvent from a class component to a function component.
  • Why: Fixes [EuiWindowEvent] Migrate from class to function component #9457 — part of the ongoing effort to migrate class components to functional components.
  • How: Added EuiWindowEvent as a functional equivalent using useEffect with [event, handler] dependencies to match the class component's update logic (only re-registers the listener when event or handler change).

API Changes

No API changes

Screenshots

No visual changes

Impact Assessment

  • [ ] 🔴 Breaking changes
  • [ ] 💅 Visual changes
  • 🧪 Test impact — Existing snapshots may need updating if the rendered output differs slightly.
  • [ ] 🔧 Hard to integrate

Impact level: 🟢 None

Release Readiness

  • Documentation:
  • Figma:
  • Migration guide:
  • Adoption plan

QA instructions for reviewer

  • Open the EuiFlyout stories in Storybook.
  • Open a flyout and confirm it closes when pressing Escape.
  • Open a flyout, click a focusable element inside it, and confirm Escape still closes the flyout (event listener is not lost on re-render).

Checklist before marking Ready for Review

Reviewer checklist

  • Approved Impact Assessment — Acceptable to merge given the consumer impact.
  • Approved Release Readiness — Docs, Figma, and migration info are sufficient to ship.

@barlima barlima requested a review from a team as a code owner March 26, 2026 12:21
@github-actions
Copy link
Copy Markdown

👋 Since this is a community submitted pull request, a Buildkite build has not been started automatically. Would an Elastic organization member please verify the contents of this pull request and kick off a build manually?

@github-actions github-actions bot added the community contribution (Don't delete - used for automation) label Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community contribution (Don't delete - used for automation)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[EuiWindowEvent] Migrate from class to function component

1 participant