Skip to content

[EuiAccordion] Migrate from class to function component - #9558

Merged
weronikaolejniczak merged 5 commits into
elastic:mainfrom
antonbc:refactor/accordion-function-component
May 12, 2026
Merged

weronikaolejniczak merged 5 commits into
elastic:mainfrom
antonbc:refactor/accordion-function-component

Conversation

@antonbc

@antonbc antonbc commented Apr 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

API Changes

No API changes.

component / parent prop / child change description

Screenshots

No visual changes

Before After
{Before image} {After image}

Impact Assessment

Note: Most PRs should be tested in Kibana to help gauge their Impact before merging.

  • 🔴 Breaking changes
  • 💅 Visual changes
  • 🧪 Test impact — None. All 39 existing tests pass, 21 snapshots match.
  • 🔧 Hard to integrate

Impact level: 🟢 None / 🟢 Low / 🟡 Moderate / 🔴 High

Release Readiness

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

QA instructions for reviewer

Checklist before marking Ready for Review

Reviewer checklist

  • Convert to function component with useState
  • Replace withEuiTheme HOC with useEuiTheme hook if applicable
  • Maintain controlled/uncontrolled open state behavior
  • All existing tests pass

@antonbc
antonbc requested a review from a team as a code owner April 4, 2026 07:30
Copilot AI review requested due to automatic review settings April 4, 2026 07:30
@cla-checker-service

cla-checker-service Bot commented Apr 4, 2026 •

Copy link
Copy Markdown

💚 CLA has been signed

@github-actions

github-actions Bot commented Apr 4, 2026

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 Apr 4, 2026
@antonbc antonbc closed this Apr 4, 2026
@antonbc antonbc reopened this Apr 4, 2026
@github-actions

github-actions Bot commented Apr 4, 2026

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?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates EuiAccordion from a class component wrapped in withEuiTheme to a function component that uses hooks (useEuiTheme, useGeneratedHtmlId) while aiming to keep behavior and public API the same.

Changes:

  • Replaced class state/handlers with useState and an internal toggle handler.
  • Replaced withEuiTheme + WithEuiThemeProps usage with useEuiTheme.
  • Replaced htmlIdGenerator() instance property with useGeneratedHtmlId().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@weronikaolejniczak weronikaolejniczak added the skip-changelog Use on PRs to skip changelog requirement (Don't delete - used for automation) label Apr 7, 2026
@antonbc

antonbc commented May 5, 2026

Copy link
Copy Markdown
Contributor Author

Hi, I have removed the unnecessary changelog and addressed all the comments. Please let me know if anything else needs attention!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@weronikaolejniczak weronikaolejniczak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything LGTM! Thank you for addressing my comments and for contributing, @antonbc 🙏🏻

The next EUI release scope is closed so we won't be able to merge the PR this week.

@elasticmachine

Copy link
Copy Markdown
Collaborator

💚 Build Succeeded

History

@elasticmachine

Copy link
Copy Markdown
Collaborator

💚 Build Succeeded

History

@weronikaolejniczak
weronikaolejniczak merged commit e708b6f into elastic:main May 12, 2026
1 check passed
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) skip-changelog Use on PRs to skip changelog requirement (Don't delete - used for automation)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants