Skip to content

[EuiSideNav] Migrate from class to function component#9533

Open
CollegeRideOut wants to merge 2 commits intoelastic:mainfrom
CollegeRideOut:9475-eui-side-nav-function
Open

[EuiSideNav] Migrate from class to function component#9533
CollegeRideOut wants to merge 2 commits intoelastic:mainfrom
CollegeRideOut:9475-eui-side-nav-function

Conversation

@CollegeRideOut
Copy link
Copy Markdown
Contributor

Summary

What: Convert EuiSideNav from a class component to a function component.

Why: Closes #9475

How:

  • Replaced the class component with a function component using hooks

  • Removed withEuiTheme HOC and replaced it with useEuiTheme

  • Preserved existing behavior and structure

  • Replaced defaultProps with default values in props destructuring


API Changes

component / parent | prop / child | change | description -- | -- | -- | -- N/A |   | None | No public API changes

Impact Assessment

  • 🔴 Breaking changes

  • 💅 Visual changes

  • 🧪 Test impact

  • 🔧 Hard to integrate

Impact level: 🟢 None


QA instructions for reviewer

  • Verify EuiSideNav renders as expected

  • Confirm navigation items expand/collapse correctly

  • Ensure no visual or behavioral regressions


Checklist before marking Ready for Review

  • Filled out all sections above

## Summary

What: Convert EuiSideNav from a class component to a function component.

Why: Closes [#9475](#9475)

How:

  • Replaced the class component with a function component using hooks
  • Removed withEuiTheme HOC and replaced it with useEuiTheme
  • Preserved existing behavior and structure
  • Replaced defaultProps with default values in props destructuring

API Changes

component / parent prop / child change description
N/A None No public API changes

Impact level: 🟢 None


QA instructions for reviewer

  • Verify EuiSideNav renders as expected
  • Confirm navigation items expand/collapse correctly
  • Ensure no visual or behavioral regressions

Checklist before marking Ready for Review

  • Filled out all sections above

This Message was generated by AI. Also I used AI tools when working on this but I did all the changes myself (locally my yarn lint was not working, but I did run prettier before commiting)

@CollegeRideOut CollegeRideOut requested a review from a team as a code owner March 25, 2026 18:48
@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 25, 2026
@weronikaolejniczak
Copy link
Copy Markdown
Contributor

buildkite test this

@weronikaolejniczak weronikaolejniczak added the skip-changelog Use on PRs to skip changelog requirement (Don't delete - used for automation) label Mar 26, 2026
Comment thread packages/eui/src/components/side_nav/side_nav.tsx Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Migrates EuiSideNav from a stateless class component using withEuiTheme to a function component using hooks, aligning it with modern EUI patterns and closing #9475.

Changes:

  • Converted EuiSideNav from class to function component
  • Replaced withEuiTheme with useEuiTheme
  • Replaced defaultProps with default values in props destructuring

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

Comment thread packages/eui/src/components/side_nav/side_nav.tsx Outdated
Comment thread packages/eui/src/components/side_nav/side_nav.tsx
Co-authored-by: Weronika Olejniczak <32842468+weronikaolejniczak@users.noreply.github.com>
@weronikaolejniczak
Copy link
Copy Markdown
Contributor

buildkite test this

@elasticmachine
Copy link
Copy Markdown
Collaborator

💔 Build Failed

Failed CI Steps

History

@elasticmachine
Copy link
Copy Markdown
Collaborator

💔 Build Failed

Failed CI Steps

History

@weronikaolejniczak weronikaolejniczak self-requested a review April 1, 2026 12:09
Copy link
Copy Markdown
Contributor

@weronikaolejniczak weronikaolejniczak left a comment

Choose a reason for hiding this comment

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

The CI is failing at the Linting step. It's because there's a syntax issue in packages/eui/src/components/side_nav/side_nav.tsx. @CollegeRideOut could you update it? 🙏🏻

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.

[EuiSideNav] Migrate from class to function component

4 participants