diff --git a/hooks/src/index.js b/hooks/src/index.js
index 72511b0e21d..931f9d7ad7e 100644
--- a/hooks/src/index.js
+++ b/hooks/src/index.js
@@ -367,15 +367,6 @@ export function useErrorBoundary(cb) {
];
}
-function hash(s) {
- let h = 0,
- i = s.length;
- while (i > 0) {
- h = ((h << 5) - h + s.charCodeAt(--i)) | 0;
- }
- return h;
-}
-
export function useId() {
const state = getHookState(currentIndex++, 11);
if (!state._value) {
@@ -401,7 +392,7 @@ export function useId() {
// Increase the current component depth pointer
ids[i - 1]++;
- state._value = 'P' + hash(ids.join('')) + currentIndex;
+ state._value = 'P' + ids.join('') + currentIndex;
}
return state._value;
diff --git a/hooks/test/browser/useId.test.js b/hooks/test/browser/useId.test.js
index 4d96b40e452..a78453bf675 100644
--- a/hooks/test/browser/useId.test.js
+++ b/hooks/test/browser/useId.test.js
@@ -55,12 +55,12 @@ describe('useId', () => {
render(
P481
P15671
P01
P011