You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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()
The text was updated successfully, but these errors were encountered:
👋 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.
❌ 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.
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 utilizinghtmlIdGenerator
that can't use this new fancy hook directly.Acceptance Criteria
<EuiSsrProvider>
should be implemented to provide a new React contextprefix: 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 inuseGeneratedHtmlId()
The text was updated successfully, but these errors were encountered: