GeezerVison is showing github.com — Revert "Append text string to <Text> error message (#19581)" (#19723) · react/react@380dc95
File treeExpand file treeCollapse file tree Open diff view settings packages/react-native-renderer/src
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: packages/react-native-renderer/src/ReactFabricHostConfig.js +1-2Lines changed: 1 addition & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -244,8 +244,7 @@ export function createTextInstance( | 244 | 244 | ): TextInstance { | 245 | 245 | invariant( | 246 | 246 | hostContext.isInAParentText, | 247 | | - 'Text string must be rendered within a <Text> component.\n\nText: %s', | 248 | | - text.length > 100 ? text.substr(0, 88) + ' (truncated)' : text, | | 247 | + 'Text strings must be rendered within a <Text> component.', | 249 | 248 | ); | 250 | 249 |
| 251 | 250 | const tag = nextReactTag; | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-native-renderer/src/ReactNativeHostConfig.js +1-2Lines changed: 1 addition & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -146,8 +146,7 @@ export function createTextInstance( | 146 | 146 | ): TextInstance { | 147 | 147 | invariant( | 148 | 148 | hostContext.isInAParentText, | 149 | | - 'Text string must be rendered within a <Text> component.\n\nText: %s', | 150 | | - text.length > 100 ? text.substr(0, 88) + ' (truncated)' : text, | | 149 | + 'Text strings must be rendered within a <Text> component.', | 151 | 150 | ); | 152 | 151 |
| 153 | 152 | const tag = allocateTag(); | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-native-renderer/src/__tests__/ReactFabric-test.internal.js +2-12Lines changed: 2 additions & 12 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -563,15 +563,7 @@ describe('ReactFabric', () => { | 563 | 563 | })); | 564 | 564 |
| 565 | 565 | expect(() => ReactFabric.render(<View>this should warn</View>, 11)).toThrow( | 566 | | - 'Text string must be rendered within a <Text> component.\n\nText: this should warn', | 567 | | - ); | 568 | | - | 569 | | - expect(() => | 570 | | - ReactFabric.render(<View>{'x'.repeat(200)}</View>, 11), | 571 | | - ).toThrow( | 572 | | - `Text string must be rendered within a <Text> component.\n\nText: ${'x'.repeat( | 573 | | - 88, | 574 | | - )} (truncated)`, | | 566 | + 'Text strings must be rendered within a <Text> component.', | 575 | 567 | ); | 576 | 568 |
| 577 | 569 | expect(() => | @@ -581,9 +573,7 @@ describe('ReactFabric', () => { | 581 | 573 | </Text>, | 582 | 574 | 11, | 583 | 575 | ), | 584 | | - ).toThrow( | 585 | | - 'Text string must be rendered within a <Text> component.\n\nText: hi hello hi', | 586 | | - ); | | 576 | + ).toThrow('Text strings must be rendered within a <Text> component.'); | 587 | 577 | }); | 588 | 578 |
| 589 | 579 | it('should not throw for text inside of an indirect <Text> ancestor', () => { | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-native-renderer/src/__tests__/ReactNativeMount-test.internal.js +2-12Lines changed: 2 additions & 12 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -423,15 +423,7 @@ describe('ReactNative', () => { | 423 | 423 | })); | 424 | 424 |
| 425 | 425 | expect(() => ReactNative.render(<View>this should warn</View>, 11)).toThrow( | 426 | | - 'Text string must be rendered within a <Text> component.\n\nText: this should warn', | 427 | | - ); | 428 | | - | 429 | | - expect(() => | 430 | | - ReactNative.render(<View>{'x'.repeat(200)}</View>, 11), | 431 | | - ).toThrow( | 432 | | - `Text string must be rendered within a <Text> component.\n\nText: ${'x'.repeat( | 433 | | - 88, | 434 | | - )} (truncated)`, | | 426 | + 'Text strings must be rendered within a <Text> component.', | 435 | 427 | ); | 436 | 428 |
| 437 | 429 | expect(() => | @@ -441,9 +433,7 @@ describe('ReactNative', () => { | 441 | 433 | </Text>, | 442 | 434 | 11, | 443 | 435 | ), | 444 | | - ).toThrow( | 445 | | - 'Text string must be rendered within a <Text> component.\n\nText: hi hello hi', | 446 | | - ); | | 436 | + ).toThrow('Text strings must be rendered within a <Text> component.'); | 447 | 437 | }); | 448 | 438 |
| 449 | 439 | it('should not throw for text inside of an indirect <Text> ancestor', () => { | |
|