From 9c405850e1a5a424296775b13de970041a2ab2ce Mon Sep 17 00:00:00 2001 From: AsanAzimkulov Date: Sun, 15 Oct 2023 20:01:35 +0600 Subject: [PATCH] Fix: error messages Changes `before before` to `before` in error messages. --- .../src/__tests__/ReactDOMAttribute-test.js | 2 +- .../src/__tests__/ReactDOMComponent-test.js | 2 +- .../src/__tests__/ReactDOMInput-test.js | 8 +++---- .../src/__tests__/ReactDOMSelect-test.js | 22 +++++++++---------- .../src/__tests__/ReactDOMTextarea-test.js | 2 +- .../src/__tests__/ReactIdentity-test.js | 2 +- packages/shared/CheckStringCoercion.js | 12 +++++----- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js b/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js index b8feea0e6756d..33ebaa179b62f 100644 --- a/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js @@ -106,7 +106,7 @@ describe('ReactDOM unknown attribute', () => { expect(test).toThrowError(new TypeError('prod message')), ).toErrorDev( 'Warning: The provided `unknown` attribute is an unsupported type TemporalLike.' + - ' This value must be coerced to a string before before using it here.', + ' This value must be coerced to a string before using it here.', ); }); diff --git a/packages/react-dom/src/__tests__/ReactDOMComponent-test.js b/packages/react-dom/src/__tests__/ReactDOMComponent-test.js index 2e903aba8abf8..3ee19c72e2e09 100644 --- a/packages/react-dom/src/__tests__/ReactDOMComponent-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMComponent-test.js @@ -276,7 +276,7 @@ describe('ReactDOMComponent', () => { expect(test).toThrowError(new TypeError('prod message')), ).toErrorDev( 'Warning: The provided `fontSize` CSS property is an unsupported type TemporalLike.' + - ' This value must be coerced to a string before before using it here.', + ' This value must be coerced to a string before using it here.', ); }); diff --git a/packages/react-dom/src/__tests__/ReactDOMInput-test.js b/packages/react-dom/src/__tests__/ReactDOMInput-test.js index 474cae8bb60d7..cdad638c6addb 100644 --- a/packages/react-dom/src/__tests__/ReactDOMInput-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMInput-test.js @@ -631,7 +631,7 @@ describe('ReactDOMInput', () => { expect(test).toThrowError(new TypeError('prod message')), ).toErrorDev( 'Form field values (value, checked, defaultValue, or defaultChecked props) must be ' + - 'strings, not TemporalLike. This value must be coerced to a string before before using it here.', + 'strings, not TemporalLike. This value must be coerced to a string before using it here.', ); }); @@ -655,7 +655,7 @@ describe('ReactDOMInput', () => { expect(test).toThrowError(new TypeError('prod message')), ).toErrorDev( 'Form field values (value, checked, defaultValue, or defaultChecked props) must be ' + - 'strings, not TemporalLike. This value must be coerced to a string before before using it here.', + 'strings, not TemporalLike. This value must be coerced to a string before using it here.', ); }); @@ -679,7 +679,7 @@ describe('ReactDOMInput', () => { expect(test).toThrowError(new TypeError('prod message')), ).toErrorDev( 'Form field values (value, checked, defaultValue, or defaultChecked props) must be ' + - 'strings, not TemporalLike. This value must be coerced to a string before before using it here.', + 'strings, not TemporalLike. This value must be coerced to a string before using it here.', ); }); @@ -703,7 +703,7 @@ describe('ReactDOMInput', () => { expect(test).toThrowError(new TypeError('prod message')), ).toErrorDev( 'Form field values (value, checked, defaultValue, or defaultChecked props) must be ' + - 'strings, not TemporalLike. This value must be coerced to a string before before using it here.', + 'strings, not TemporalLike. This value must be coerced to a string before using it here.', ); }); diff --git a/packages/react-dom/src/__tests__/ReactDOMSelect-test.js b/packages/react-dom/src/__tests__/ReactDOMSelect-test.js index 9037028b9f037..4332c52d124ec 100644 --- a/packages/react-dom/src/__tests__/ReactDOMSelect-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMSelect-test.js @@ -1054,7 +1054,7 @@ describe('ReactDOMSelect', () => { ).toErrorDev( 'Form field values (value, checked, defaultValue, or defaultChecked props)' + ' must be strings, not TemporalLike. ' + - 'This value must be coerced to a string before before using it here.', + 'This value must be coerced to a string before using it here.', ); }); @@ -1074,7 +1074,7 @@ describe('ReactDOMSelect', () => { expect(test).toThrowError(new TypeError('prod message')), ).toErrorDev( 'The provided `value` attribute is an unsupported type TemporalLike.' + - ' This value must be coerced to a string before before using it here.', + ' This value must be coerced to a string before using it here.', ); }); @@ -1094,7 +1094,7 @@ describe('ReactDOMSelect', () => { expect(test).toThrowError(new TypeError('prod message')), ).toErrorDev( 'The provided `value` attribute is an unsupported type TemporalLike.' + - ' This value must be coerced to a string before before using it here.', + ' This value must be coerced to a string before using it here.', ); }); @@ -1120,7 +1120,7 @@ describe('ReactDOMSelect', () => { ).toErrorDev( 'Form field values (value, checked, defaultValue, or defaultChecked props)' + ' must be strings, not TemporalLike. ' + - 'This value must be coerced to a string before before using it here.', + 'This value must be coerced to a string before using it here.', ); }); @@ -1147,7 +1147,7 @@ describe('ReactDOMSelect', () => { expect(test).toThrowError(new TypeError('prod message')), ).toErrorDev( 'The provided `value` attribute is an unsupported type TemporalLike.' + - ' This value must be coerced to a string before before using it here.', + ' This value must be coerced to a string before using it here.', ); }); @@ -1174,7 +1174,7 @@ describe('ReactDOMSelect', () => { expect(test).toThrowError(new TypeError('prod message')), ).toErrorDev( 'The provided `value` attribute is an unsupported type TemporalLike.' + - ' This value must be coerced to a string before before using it here.', + ' This value must be coerced to a string before using it here.', ); }); @@ -1193,7 +1193,7 @@ describe('ReactDOMSelect', () => { ).toErrorDev( 'Form field values (value, checked, defaultValue, or defaultChecked props)' + ' must be strings, not TemporalLike. ' + - 'This value must be coerced to a string before before using it here.', + 'This value must be coerced to a string before using it here.', ); }); @@ -1213,7 +1213,7 @@ describe('ReactDOMSelect', () => { expect(test).toThrowError(new TypeError('prod message')), ).toErrorDev( 'The provided `value` attribute is an unsupported type TemporalLike.' + - ' This value must be coerced to a string before before using it here.', + ' This value must be coerced to a string before using it here.', ); }); @@ -1233,7 +1233,7 @@ describe('ReactDOMSelect', () => { expect(test).toThrowError(new TypeError('prod message')), ).toErrorDev( 'The provided `value` attribute is an unsupported type TemporalLike.' + - ' This value must be coerced to a string before before using it here.', + ' This value must be coerced to a string before using it here.', ); }); @@ -1259,7 +1259,7 @@ describe('ReactDOMSelect', () => { ).toErrorDev( 'Form field values (value, checked, defaultValue, or defaultChecked props)' + ' must be strings, not TemporalLike. ' + - 'This value must be coerced to a string before before using it here.', + 'This value must be coerced to a string before using it here.', ); }); @@ -1286,7 +1286,7 @@ describe('ReactDOMSelect', () => { expect(test).toThrowError(new TypeError('prod message')), ).toErrorDev( 'The provided `value` attribute is an unsupported type TemporalLike.' + - ' This value must be coerced to a string before before using it here.', + ' This value must be coerced to a string before using it here.', ); }); }); diff --git a/packages/react-dom/src/__tests__/ReactDOMTextarea-test.js b/packages/react-dom/src/__tests__/ReactDOMTextarea-test.js index 347942234063d..d4cb435688d62 100644 --- a/packages/react-dom/src/__tests__/ReactDOMTextarea-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMTextarea-test.js @@ -251,7 +251,7 @@ describe('ReactDOMTextarea', () => { expect(test).toThrowError(new TypeError('prod message')), ).toErrorDev( 'Form field values (value, checked, defaultValue, or defaultChecked props) must be ' + - 'strings, not TemporalLike. This value must be coerced to a string before before using it here.', + 'strings, not TemporalLike. This value must be coerced to a string before using it here.', ); }); diff --git a/packages/react-dom/src/__tests__/ReactIdentity-test.js b/packages/react-dom/src/__tests__/ReactIdentity-test.js index 9dcfe5a184249..47814fc39d18e 100644 --- a/packages/react-dom/src/__tests__/ReactIdentity-test.js +++ b/packages/react-dom/src/__tests__/ReactIdentity-test.js @@ -288,7 +288,7 @@ describe('ReactIdentity', () => { expect(test).toThrowError(new TypeError('prod message')), ).toErrorDev( 'The provided key is an unsupported type TemporalLike.' + - ' This value must be coerced to a string before before using it here.', + ' This value must be coerced to a string before using it here.', {withoutStack: true}, ); }); diff --git a/packages/shared/CheckStringCoercion.js b/packages/shared/CheckStringCoercion.js index a229ac6dae9d6..52e0520598199 100644 --- a/packages/shared/CheckStringCoercion.js +++ b/packages/shared/CheckStringCoercion.js @@ -78,7 +78,7 @@ export function checkAttributeStringCoercion( if (willCoercionThrow(value)) { console.error( 'The provided `%s` attribute is an unsupported type %s.' + - ' This value must be coerced to a string before before using it here.', + ' This value must be coerced to a string before using it here.', attributeName, typeName(value), ); @@ -92,7 +92,7 @@ export function checkKeyStringCoercion(value: mixed): void | string { if (willCoercionThrow(value)) { console.error( 'The provided key is an unsupported type %s.' + - ' This value must be coerced to a string before before using it here.', + ' This value must be coerced to a string before using it here.', typeName(value), ); return testStringCoercion(value); // throw (to help callers find troubleshooting comments) @@ -108,7 +108,7 @@ export function checkPropStringCoercion( if (willCoercionThrow(value)) { console.error( 'The provided `%s` prop is an unsupported type %s.' + - ' This value must be coerced to a string before before using it here.', + ' This value must be coerced to a string before using it here.', propName, typeName(value), ); @@ -125,7 +125,7 @@ export function checkCSSPropertyStringCoercion( if (willCoercionThrow(value)) { console.error( 'The provided `%s` CSS property is an unsupported type %s.' + - ' This value must be coerced to a string before before using it here.', + ' This value must be coerced to a string before using it here.', propName, typeName(value), ); @@ -139,7 +139,7 @@ export function checkHtmlStringCoercion(value: mixed): void | string { if (willCoercionThrow(value)) { console.error( 'The provided HTML markup uses a value of unsupported type %s.' + - ' This value must be coerced to a string before before using it here.', + ' This value must be coerced to a string before using it here.', typeName(value), ); return testStringCoercion(value); // throw (to help callers find troubleshooting comments) @@ -153,7 +153,7 @@ export function checkFormFieldValueStringCoercion(value: mixed): void | string { console.error( 'Form field values (value, checked, defaultValue, or defaultChecked props)' + ' must be strings, not %s.' + - ' This value must be coerced to a string before before using it here.', + ' This value must be coerced to a string before using it here.', typeName(value), ); return testStringCoercion(value); // throw (to help callers find troubleshooting comments)