Skip to content

Commit 48770e4

Browse files
committed
chore: Block more React warnings
1 parent c81074d commit 48770e4

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/globals/patches.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
*/
77
const baseConsoleError = console.error.bind(console);
88
const keyWarningPattern = 'Warning: Each child in a list should have a unique "key" prop.';
9+
const valueFieldPattern = 'Warning: You provided a `value` prop to a form field without an `onChange` handler.';
910

1011
// TODO: Patch out 'checked' warnings
1112

1213
console.error = function (...args) {
13-
if (typeof args[0] === 'string' && args[0].startsWith(keyWarningPattern)) {
14+
if (typeof args[0] === 'string' && (args[0].startsWith(keyWarningPattern) || args[0].startsWith(valueFieldPattern))) {
1415
return;
1516
}
1617
return baseConsoleError(...args);

src/types/chat.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export type PSCommand = {
112112
/**
113113
* Command syntax.
114114
* Disable explicitly by passing null.
115-
* Start with a CMD
115+
* Start with a CMD.
116116
*/
117117
syntax: string | null;
118118
/**

0 commit comments

Comments
 (0)