GeezerVison is showing github.com — use a different link in the UNSAFE_ component warnings (#16321) · react/react@66a4742
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: packages/react-dom/src/__tests__/ReactComponentLifeCycle-test.js +11-11Lines changed: 11 additions & 11 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -811,7 +811,7 @@ describe('ReactComponentLifeCycle', () => { | 811 | 811 | ' UNSAFE_componentWillReceiveProps\n' + | 812 | 812 | ' componentWillUpdate\n\n' + | 813 | 813 | 'The above lifecycles should be removed. Learn more about this warning here:\n' + | 814 | | - 'https://fb.me/react-async-component-lifecycle-hooks', | | 814 | + 'https://fb.me/react-unsafe-component-lifecycles', | 815 | 815 | {withoutStack: true}, | 816 | 816 | ); | 817 | 817 | }).toLowPriorityWarnDev( | @@ -838,7 +838,7 @@ describe('ReactComponentLifeCycle', () => { | 838 | 838 | 'WillMount uses getDerivedStateFromProps() but also contains the following legacy lifecycles:\n' + | 839 | 839 | ' UNSAFE_componentWillMount\n\n' + | 840 | 840 | 'The above lifecycles should be removed. Learn more about this warning here:\n' + | 841 | | - 'https://fb.me/react-async-component-lifecycle-hooks', | | 841 | + 'https://fb.me/react-unsafe-component-lifecycles', | 842 | 842 | {withoutStack: true}, | 843 | 843 | ); | 844 | 844 |
| @@ -863,7 +863,7 @@ describe('ReactComponentLifeCycle', () => { | 863 | 863 | ' componentWillMount\n' + | 864 | 864 | ' UNSAFE_componentWillUpdate\n\n' + | 865 | 865 | 'The above lifecycles should be removed. Learn more about this warning here:\n' + | 866 | | - 'https://fb.me/react-async-component-lifecycle-hooks', | | 866 | + 'https://fb.me/react-unsafe-component-lifecycles', | 867 | 867 | {withoutStack: true}, | 868 | 868 | ); | 869 | 869 | }).toLowPriorityWarnDev(['componentWillMount has been renamed'], { | @@ -887,7 +887,7 @@ describe('ReactComponentLifeCycle', () => { | 887 | 887 | 'WillReceiveProps uses getDerivedStateFromProps() but also contains the following legacy lifecycles:\n' + | 888 | 888 | ' componentWillReceiveProps\n\n' + | 889 | 889 | 'The above lifecycles should be removed. Learn more about this warning here:\n' + | 890 | | - 'https://fb.me/react-async-component-lifecycle-hooks', | | 890 | + 'https://fb.me/react-unsafe-component-lifecycles', | 891 | 891 | {withoutStack: true}, | 892 | 892 | ); | 893 | 893 | }).toLowPriorityWarnDev(['componentWillReceiveProps has been renamed'], { | @@ -920,7 +920,7 @@ describe('ReactComponentLifeCycle', () => { | 920 | 920 | ' UNSAFE_componentWillReceiveProps\n' + | 921 | 921 | ' componentWillUpdate\n\n' + | 922 | 922 | 'The above lifecycles should be removed. Learn more about this warning here:\n' + | 923 | | - 'https://fb.me/react-async-component-lifecycle-hooks', | | 923 | + 'https://fb.me/react-unsafe-component-lifecycles', | 924 | 924 | {withoutStack: true}, | 925 | 925 | ); | 926 | 926 | }).toLowPriorityWarnDev( | @@ -946,7 +946,7 @@ describe('ReactComponentLifeCycle', () => { | 946 | 946 | 'WillMount uses getSnapshotBeforeUpdate() but also contains the following legacy lifecycles:\n' + | 947 | 947 | ' UNSAFE_componentWillMount\n\n' + | 948 | 948 | 'The above lifecycles should be removed. Learn more about this warning here:\n' + | 949 | | - 'https://fb.me/react-async-component-lifecycle-hooks', | | 949 | + 'https://fb.me/react-unsafe-component-lifecycles', | 950 | 950 | {withoutStack: true}, | 951 | 951 | ); | 952 | 952 |
| @@ -970,7 +970,7 @@ describe('ReactComponentLifeCycle', () => { | 970 | 970 | ' componentWillMount\n' + | 971 | 971 | ' UNSAFE_componentWillUpdate\n\n' + | 972 | 972 | 'The above lifecycles should be removed. Learn more about this warning here:\n' + | 973 | | - 'https://fb.me/react-async-component-lifecycle-hooks', | | 973 | + 'https://fb.me/react-unsafe-component-lifecycles', | 974 | 974 | {withoutStack: true}, | 975 | 975 | ); | 976 | 976 | }).toLowPriorityWarnDev(['componentWillMount has been renamed'], { | @@ -993,7 +993,7 @@ describe('ReactComponentLifeCycle', () => { | 993 | 993 | 'WillReceiveProps uses getSnapshotBeforeUpdate() but also contains the following legacy lifecycles:\n' + | 994 | 994 | ' componentWillReceiveProps\n\n' + | 995 | 995 | 'The above lifecycles should be removed. Learn more about this warning here:\n' + | 996 | | - 'https://fb.me/react-async-component-lifecycle-hooks', | | 996 | + 'https://fb.me/react-unsafe-component-lifecycles', | 997 | 997 | {withoutStack: true}, | 998 | 998 | ); | 999 | 999 | }).toLowPriorityWarnDev(['componentWillReceiveProps has been renamed'], { | @@ -1410,20 +1410,20 @@ describe('ReactComponentLifeCycle', () => { | 1410 | 1410 | ).toLowPriorityWarnDev( | 1411 | 1411 | [ | 1412 | 1412 | /* eslint-disable max-len */ | 1413 | | - `Warning: componentWillMount has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details. | | 1413 | + `Warning: componentWillMount has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details. | 1414 | 1414 |
| 1415 | 1415 | * Move code with side effects to componentDidMount, and set initial state in the constructor. | 1416 | 1416 | * Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder. | 1417 | 1417 |
| 1418 | 1418 | Please update the following components: MyComponent`, | 1419 | | - `Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details. | | 1419 | + `Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details. | 1420 | 1420 |
| 1421 | 1421 | * Move data fetching code or side effects to componentDidUpdate. | 1422 | 1422 | * If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state | 1423 | 1423 | * Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder. | 1424 | 1424 |
| 1425 | 1425 | Please update the following components: MyComponent`, | 1426 | | - `Warning: componentWillUpdate has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details. | | 1426 | + `Warning: componentWillUpdate has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details. | 1427 | 1427 |
| 1428 | 1428 | * Move data fetching code or side effects to componentDidUpdate. | 1429 | 1429 | * Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder. | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-dom/src/server/ReactPartialRenderer.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -583,7 +583,7 @@ function resolve( | 583 | 583 | false, | 584 | 584 | // keep this warning in sync with ReactStrictModeWarning.js | 585 | 585 | 'componentWillMount has been renamed, and is not recommended for use. ' + | 586 | | - 'See https://fb.me/react-async-component-lifecycle-hooks for details.\n\n' + | | 586 | + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + | 587 | 587 | '* Move code from componentWillMount to componentDidMount (preferred in most cases) ' + | 588 | 588 | 'or the constructor.\n' + | 589 | 589 | '\nPlease update the following components: %s', | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberClassComponent.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -702,7 +702,7 @@ function constructClassInstance( | 702 | 702 | 'Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' + | 703 | 703 | '%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\n' + | 704 | 704 | 'The above lifecycles should be removed. Learn more about this warning here:\n' + | 705 | | - 'https://fb.me/react-async-component-lifecycle-hooks', | | 705 | + 'https://fb.me/react-unsafe-component-lifecycles', | 706 | 706 | componentName, | 707 | 707 | newApiName, | 708 | 708 | foundWillMountName !== null ? `\n ${foundWillMountName}` : '', | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactStrictModeWarnings.js +6-6Lines changed: 6 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -194,7 +194,7 @@ if (__DEV__) { | 194 | 194 | warningWithoutStack( | 195 | 195 | false, | 196 | 196 | 'Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. ' + | 197 | | - 'See https://fb.me/react-async-component-lifecycle-hooks for details.\n\n' + | | 197 | + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + | 198 | 198 | '* Move code with side effects to componentDidMount, and set initial state in the constructor.\n' + | 199 | 199 | '\nPlease update the following components: %s', | 200 | 200 | sortedNames, | @@ -209,7 +209,7 @@ if (__DEV__) { | 209 | 209 | false, | 210 | 210 | 'Using UNSAFE_componentWillReceiveProps in strict mode is not recommended ' + | 211 | 211 | 'and may indicate bugs in your code. ' + | 212 | | - 'See https://fb.me/react-async-component-lifecycle-hooks for details.\n\n' + | | 212 | + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + | 213 | 213 | '* Move data fetching code or side effects to componentDidUpdate.\n' + | 214 | 214 | "* If you're updating state whenever props change, " + | 215 | 215 | 'refactor your code to use memoization techniques or move it to ' + | @@ -227,7 +227,7 @@ if (__DEV__) { | 227 | 227 | false, | 228 | 228 | 'Using UNSAFE_componentWillUpdate in strict mode is not recommended ' + | 229 | 229 | 'and may indicate bugs in your code. ' + | 230 | | - 'See https://fb.me/react-async-component-lifecycle-hooks for details.\n\n' + | | 230 | + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + | 231 | 231 | '* Move data fetching code or side effects to componentDidUpdate.\n' + | 232 | 232 | '\nPlease update the following components: %s', | 233 | 233 | sortedNames, | @@ -240,7 +240,7 @@ if (__DEV__) { | 240 | 240 | lowPriorityWarning( | 241 | 241 | false, | 242 | 242 | 'componentWillMount has been renamed, and is not recommended for use. ' + | 243 | | - 'See https://fb.me/react-async-component-lifecycle-hooks for details.\n\n' + | | 243 | + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + | 244 | 244 | '* Move code with side effects to componentDidMount, and set initial state in the constructor.\n' + | 245 | 245 | '* Rename componentWillMount to UNSAFE_componentWillMount to suppress ' + | 246 | 246 | 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' + | @@ -259,7 +259,7 @@ if (__DEV__) { | 259 | 259 | lowPriorityWarning( | 260 | 260 | false, | 261 | 261 | 'componentWillReceiveProps has been renamed, and is not recommended for use. ' + | 262 | | - 'See https://fb.me/react-async-component-lifecycle-hooks for details.\n\n' + | | 262 | + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + | 263 | 263 | '* Move data fetching code or side effects to componentDidUpdate.\n' + | 264 | 264 | "* If you're updating state whenever props change, refactor your " + | 265 | 265 | 'code to use memoization techniques or move it to ' + | @@ -279,7 +279,7 @@ if (__DEV__) { | 279 | 279 | lowPriorityWarning( | 280 | 280 | false, | 281 | 281 | 'componentWillUpdate has been renamed, and is not recommended for use. ' + | 282 | | - 'See https://fb.me/react-async-component-lifecycle-hooks for details.\n\n' + | | 282 | + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + | 283 | 283 | '* Move data fetching code or side effects to componentDidUpdate.\n' + | 284 | 284 | '* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress ' + | 285 | 285 | 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' + | |
Collapse file Copy file name to clipboardExpand all lines: packages/react/src/__tests__/ReactStrictMode-test.internal.js +9-9Lines changed: 9 additions & 9 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -351,18 +351,18 @@ describe('ReactStrictMode', () => { | 351 | 351 | expect(() => Scheduler.unstable_flushAll()).toWarnDev( | 352 | 352 | [ | 353 | 353 | /* eslint-disable max-len */ | 354 | | - `Warning: Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://fb.me/react-async-component-lifecycle-hooks for details. | | 354 | + `Warning: Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://fb.me/react-unsafe-component-lifecycles for details. | 355 | 355 |
| 356 | 356 | * Move code with side effects to componentDidMount, and set initial state in the constructor. | 357 | 357 |
| 358 | 358 | Please update the following components: AsyncRoot`, | 359 | | - `Warning: Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://fb.me/react-async-component-lifecycle-hooks for details. | | 359 | + `Warning: Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://fb.me/react-unsafe-component-lifecycles for details. | 360 | 360 |
| 361 | 361 | * Move data fetching code or side effects to componentDidUpdate. | 362 | 362 | * If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state | 363 | 363 |
| 364 | 364 | Please update the following components: Bar, Foo`, | 365 | | - `Warning: Using UNSAFE_componentWillUpdate in strict mode is not recommended and may indicate bugs in your code. See https://fb.me/react-async-component-lifecycle-hooks for details. | | 365 | + `Warning: Using UNSAFE_componentWillUpdate in strict mode is not recommended and may indicate bugs in your code. See https://fb.me/react-unsafe-component-lifecycles for details. | 366 | 366 |
| 367 | 367 | * Move data fetching code or side effects to componentDidUpdate. | 368 | 368 |
| @@ -409,18 +409,18 @@ Please update the following components: AsyncRoot`, | 409 | 409 | expect(() => Scheduler.unstable_flushAll()).toWarnDev( | 410 | 410 | [ | 411 | 411 | /* eslint-disable max-len */ | 412 | | - `Warning: Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://fb.me/react-async-component-lifecycle-hooks for details. | | 412 | + `Warning: Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://fb.me/react-unsafe-component-lifecycles for details. | 413 | 413 |
| 414 | 414 | * Move code with side effects to componentDidMount, and set initial state in the constructor. | 415 | 415 |
| 416 | 416 | Please update the following components: AsyncRoot`, | 417 | | - `Warning: Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://fb.me/react-async-component-lifecycle-hooks for details. | | 417 | + `Warning: Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://fb.me/react-unsafe-component-lifecycles for details. | 418 | 418 |
| 419 | 419 | * Move data fetching code or side effects to componentDidUpdate. | 420 | 420 | * If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state | 421 | 421 |
| 422 | 422 | Please update the following components: Child`, | 423 | | - `Warning: Using UNSAFE_componentWillUpdate in strict mode is not recommended and may indicate bugs in your code. See https://fb.me/react-async-component-lifecycle-hooks for details. | | 423 | + `Warning: Using UNSAFE_componentWillUpdate in strict mode is not recommended and may indicate bugs in your code. See https://fb.me/react-unsafe-component-lifecycles for details. | 424 | 424 |
| 425 | 425 | * Move data fetching code or side effects to componentDidUpdate. | 426 | 426 |
| @@ -432,20 +432,20 @@ Please update the following components: AsyncRoot`, | 432 | 432 | }).toLowPriorityWarnDev( | 433 | 433 | [ | 434 | 434 | /* eslint-disable max-len */ | 435 | | - `Warning: componentWillMount has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details. | | 435 | + `Warning: componentWillMount has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details. | 436 | 436 |
| 437 | 437 | * Move code with side effects to componentDidMount, and set initial state in the constructor. | 438 | 438 | * Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder. | 439 | 439 |
| 440 | 440 | Please update the following components: Parent`, | 441 | | - `Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details. | | 441 | + `Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details. | 442 | 442 |
| 443 | 443 | * Move data fetching code or side effects to componentDidUpdate. | 444 | 444 | * If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state | 445 | 445 | * Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder. | 446 | 446 |
| 447 | 447 | Please update the following components: Parent`, | 448 | | - `Warning: componentWillUpdate has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details. | | 448 | + `Warning: componentWillUpdate has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details. | 449 | 449 |
| 450 | 450 | * Move data fetching code or side effects to componentDidUpdate. | 451 | 451 | * Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder. | |
Collapse file Copy file name to clipboardExpand all lines: packages/react/src/__tests__/createReactClassIntegration-test.js +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -559,7 +559,7 @@ describe('create-react-class-integration', () => { | 559 | 559 | ' componentWillReceiveProps\n' + | 560 | 560 | ' componentWillUpdate\n\n' + | 561 | 561 | 'The above lifecycles should be removed. Learn more about this warning here:\n' + | 562 | | - 'https://fb.me/react-async-component-lifecycle-hooks', | | 562 | + 'https://fb.me/react-unsafe-component-lifecycles', | 563 | 563 | {withoutStack: true}, | 564 | 564 | ); | 565 | 565 | }).toLowPriorityWarnDev( | @@ -603,7 +603,7 @@ describe('create-react-class-integration', () => { | 603 | 603 | ' componentWillReceiveProps\n' + | 604 | 604 | ' componentWillUpdate\n\n' + | 605 | 605 | 'The above lifecycles should be removed. Learn more about this warning here:\n' + | 606 | | - 'https://fb.me/react-async-component-lifecycle-hooks', | | 606 | + 'https://fb.me/react-unsafe-component-lifecycles', | 607 | 607 | {withoutStack: true}, | 608 | 608 | ); | 609 | 609 | }).toLowPriorityWarnDev( | |
|