We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a1e8485 commit 0e1293aCopy full SHA for 0e1293a
3 files changed
src/globals/index.ts
@@ -0,0 +1,2 @@
1
+import '@/globals/patches';
2
+import '@/globals/prototypes';
src/globals/patches.ts
@@ -0,0 +1,15 @@
+/* eslint-disable no-console */
+
3
+/**
4
+ * Patch out React key warnings
5
+ * @see https://github.com/facebook/react/issues/12567
6
+ */
7
+const baseConsoleError = console.error.bind(console);
8
+const keyWarningPattern = 'Warning: Each child in a list should have a unique "key" prop.';
9
10
+console.error = function (...args) {
11
+ if (typeof args[0] === 'string' && args[0].startsWith(keyWarningPattern)) {
12
+ return;
13
+ }
14
+ return baseConsoleError(...args);
15
+};
src/index.ts
@@ -1,5 +1,5 @@
import 'dotenv/config';
-import '@/globals/prototypes';
+import '@/globals';
import { log } from '@/utils/logger';
0 commit comments