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
Components that use the randomly generated IDs can have duplicate IDs, if a multiple versions of PF are loaded into the browser. A typical example is an environment that uses module federation.
How do you reproduce the problem?
Create a module federation environment, with 2 modules that share @patternfly/react-coreusing different versions so the modules do not meet the version range requirements.
Use some components that use the GenerateId wrapper. There will be duplicate IDs
Expected behavior
Each ID will be unique.
Is this issue blocking you?
Causes some bugs in HCC
Screenshots
Possible fixes
Make the sequence global by storing the current sequence value in the globalThis:
Problem
Components that use the randomly generated IDs can have duplicate IDs, if a multiple versions of PF are loaded into the browser. A typical example is an environment that uses module federation.
How do you reproduce the problem?
Create a module federation environment, with 2 modules that share
@patternfly/react-core
using different versions so the modules do not meet the version range requirements.Use some components that use the
GenerateId
wrapper. There will be duplicate IDsExpected behavior
Each ID will be unique.
Is this issue blocking you?
Causes some bugs in HCC
Screenshots
Possible fixes
Make the sequence global by storing the current sequence value in the
globalThis
:patternfly-react/packages/patternfly-4/react-core/src/internal/GenerateId/GenerateId.js
Line 21 in 159798e
Add some random string to the prefix so each module instance has a unique prefix:
patternfly-react/packages/patternfly-4/react-core/src/internal/GenerateId/GenerateId.js
Line 32 in 159798e
pf-random-id-111-
The text was updated successfully, but these errors were encountered: