Skip to content

[SSR] Implement EuiSsrProvider to provide a context for stable unique ID generation #7094

Closed as not planned

Description

@tkajtoch

Summary

To provide stable unique identifier generation between the client and server side, we need to introduce a new context to be used whenever EUI is rendered on the server and hydrated in the browser.

The official React.useId hook already provides stable ID generation in function components but is only available in React 18. We must provide a universal solution since we officially support React 16 and up and still have many class components utilizing htmlIdGenerator that can't use this new fancy hook directly.

Acceptance Criteria

  • <EuiSsrProvider> should be implemented to provide a new React context
  • The context should store the following properties
    • prefix: string - a global prefix to use in all generations in the scope of the provider instance (default to a random 6-digit hash);
    • current: number - a value incremented by one on every id generation call
  • <EuiSsrProvider> context should be used to generate stable unique IDs in useGeneratedHtmlId()

Activity

  1. github-actions commented on Feb 13, 2024

    @github-actions

    👋 Hi there - this issue hasn't had any activity in 6 months. If the EUI team has not explicitly expressed that this is something on our roadmap, it's unlikely that we'll pick this issue up. We would sincerely appreciate a PR/community contribution if this is something that matters to you! If not, and there is no further activity on this issue for another 6 months (i.e. it's stale for over a year), the issue will be auto-closed.

  2. added
    stale-issue
    on Feb 13, 2024
  3. github-actions commented on Aug 12, 2024

    @github-actions

    ❌ Per our previous message, this issue is auto-closing after having been open and inactive for a year. If you strongly feel this is still a high-priority issue, or are interested in contributing, please leave a comment or open a new issue linking to this one for context.

  4. added
    stale-issue-closed
    on Aug 12, 2024
  5. removed
    stale-issue
    stale-issue-closed
    on Mar 25, 2025
  6. added theissue type on Mar 25, 2025
  7. github-actions commented on Sep 22, 2025

    @github-actions

    👋 Hi there - this issue hasn't had any activity in 6 months. If the EUI team has not explicitly expressed that this is something on our roadmap, it's unlikely that we'll pick this issue up. We would sincerely appreciate a PR/community contribution if this is something that matters to you! If not, and there is no further activity on this issue for another 6 months (i.e. it's stale for over a year), the issue will be auto-closed.

  8. added
    stale-issue
    on Sep 22, 2025
  9. github-actions commented on Mar 21, 2026

    @github-actions

    ❌ Per our previous message, this issue is auto-closing after having been open and inactive for a year. If you strongly feel this is still a high-priority issue, or are interested in contributing, please leave a comment or open a new issue linking to this one for context.

  10. added
    stale-issue-closed
    on Mar 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stale-issuestale-issue-closedtech debt

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions