Skip to content

[EuiSideNav] Migrate from class to function component - #9533

Closed
CollegeRideOut wants to merge 2 commits into
elastic:mainfrom
CollegeRideOut:9475-eui-side-nav-function
Closed

[EuiSideNav] Migrate from class to function component#9533
CollegeRideOut wants to merge 2 commits into
elastic: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 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

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 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>
@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

@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.

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? 馃檹馃徎

@weronikaolejniczak

Copy link
Copy Markdown
Contributor

Closing this PR because it's stale. Another external contributor can pick it up.

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