Przeglądaj źródła

chore(dev): react key warnings

charlie 1 rok temu
rodzic
commit
ac3b643a11
1 zmienionych plików z 4 dodań i 1 usunięć
  1. 4 1
      src/main/frontend/utils.js

+ 4 - 1
src/main/frontend/utils.js

@@ -15,7 +15,10 @@ if (typeof window === 'undefined') {
   console.error = (...args) => {
   console.error = (...args) => {
     if (args[0]?.startsWith(
     if (args[0]?.startsWith(
       `Warning: Each child in a list should have a unique "key" prop`)) {
       `Warning: Each child in a list should have a unique "key" prop`)) {
-      return console.warn(...args)
+      console.groupCollapsed('[React] ⚠️ key warning!')
+      console.warn(...args)
+      console.groupEnd()
+      return
     }
     }
     originalError(...args)
     originalError(...args)
   }
   }