Skip to content

[Emotion] Memoize EuiHeaderSection styles - #10193

Draft
Anshuman-Prakash wants to merge 1 commit into
elastic:mainfrom
Anshuman-Prakash:memoize-header-section-styles
Draft

Anshuman-Prakash wants to merge 1 commit into
elastic:mainfrom
Anshuman-Prakash:memoize-header-section-styles

Conversation

@Anshuman-Prakash

Copy link
Copy Markdown
Contributor

Summary

Fixes #10156. Part of #10147.

Memoize EuiHeaderSection styles with useEuiMemoizedStyles(euiHeaderSectionStyles) instead of calling the generator on every render. The generator takes no arguments, so it is already a static function of the theme; the grow/side style selection stays in the component.

API Changes

None.

Screenshots

Not applicable: CSS definitions are unchanged, and all existing header snapshots pass without updates on React 17 and React 18.

Impact Assessment

Impact level: 🟢 Low — performance-only change to reuse generated styles across renders. No expected visual, behavioral, public API, or snapshot changes.

Release Readiness

  • Documentation, Figma, migration guide, and adoption plan: not applicable to this internal optimization.
  • No changelog, as requested in the issue; skip-changelog applies.

QA instructions for reviewer

From packages/eui:

  • yarn test-unit src/components/header --runInBand — passed: 62 tests, 38 snapshots on React 18.
  • yarn test-unit --react-version=17 src/components/header --runInBand — passed: 62 tests, 38 snapshots on React 17.
  • eslint src/components/header/header_section/ and yarn tsc --noEmit — no errors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 8, 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 Oct 8, 2026

This branch has not been deployed

No deployments
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.

[Emotion] Memoize EuiHeaderSection styles

1 participant