Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: error messages #27523

Merged
merged 1 commit into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/react-dom/src/__tests__/ReactDOMAttribute-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
);
});

Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/__tests__/ReactDOMComponent-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
);
});

Expand Down
8 changes: 4 additions & 4 deletions packages/react-dom/src/__tests__/ReactDOMInput-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
);
});

Expand All @@ -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.',
);
});

Expand All @@ -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.',
);
});

Expand All @@ -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.',
);
});

Expand Down
22 changes: 11 additions & 11 deletions packages/react-dom/src/__tests__/ReactDOMSelect-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
);
});

Expand All @@ -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.',
);
});

Expand All @@ -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.',
);
});

Expand All @@ -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.',
);
});

Expand All @@ -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.',
);
});

Expand All @@ -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.',
);
});

Expand All @@ -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.',
);
});

Expand All @@ -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.',
);
});

Expand All @@ -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.',
);
});

Expand All @@ -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.',
);
});

Expand All @@ -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.',
);
});
});
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/__tests__/ReactDOMTextarea-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
);
});

Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/__tests__/ReactIdentity-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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},
);
});
Expand Down
12 changes: 6 additions & 6 deletions packages/shared/CheckStringCoercion.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
);
Expand All @@ -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)
Expand All @@ -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),
);
Expand All @@ -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),
);
Expand All @@ -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)
Expand All @@ -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)
Expand Down