Skip to content

Commit 4985bb0

Browse files
authored
Rename 17 to 18 in warnings (#19031)
We're not really supposed to refer to future versions by numbers. These will all slip so these numbers don't make sense anymore.
1 parent 86b4070 commit 4985bb0

17 files changed

+29
-29
lines changed

packages/react-dom/index.experimental.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ export {
2727
unstable_renderSubtreeIntoContainer,
2828
// Disabled behind disableUnstableCreatePortal
2929
// Temporary alias since we already shipped React 16 RC with it.
30-
// TODO: remove in React 17.
30+
// TODO: remove in React 18.
3131
unstable_createPortal,
3232
} from './src/client/ReactDOM';

packages/react-dom/index.stable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ export {
1919
unmountComponentAtNode,
2020
unstable_renderSubtreeIntoContainer,
2121
// Temporary alias since we already shipped React 16 RC with it.
22-
// TODO: remove in React 17.
22+
// TODO: remove in React 18.
2323
unstable_createPortal,
2424
} from './src/client/ReactDOM';

packages/react-dom/src/__tests__/ReactComponentLifeCycle-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,20 +1386,20 @@ describe('ReactComponentLifeCycle', () => {
13861386
`Warning: componentWillMount has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details.
13871387
13881388
* Move code with side effects to componentDidMount, and set initial state in the constructor.
1389-
* 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.
1389+
* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 18.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.
13901390
13911391
Please update the following components: MyComponent`,
13921392
`Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details.
13931393
13941394
* Move data fetching code or side effects to componentDidUpdate.
13951395
* 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
1396-
* 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.
1396+
* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.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.
13971397
13981398
Please update the following components: MyComponent`,
13991399
`Warning: componentWillUpdate has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details.
14001400
14011401
* Move data fetching code or side effects to componentDidUpdate.
1402-
* 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.
1402+
* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.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.
14031403
14041404
Please update the following components: MyComponent`,
14051405
/* eslint-enable max-len */

packages/react-dom/src/__tests__/ReactCompositeComponent-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ describe('ReactCompositeComponent', () => {
196196
ReactDOM.render(<Parent />, container),
197197
).toWarnDev(
198198
'render(): Calling ReactDOM.render() to hydrate server-rendered markup ' +
199-
'will stop working in React v17. Replace the ReactDOM.render() call ' +
199+
'will stop working in React v18. Replace the ReactDOM.render() call ' +
200200
'with ReactDOM.hydrate() if you want React to attach to the server HTML.',
201201
{withoutStack: true},
202202
);

packages/react-dom/src/__tests__/ReactDOMFiber-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ describe('ReactDOMFiber', () => {
246246
expect(container.innerHTML).toBe('');
247247
});
248248

249-
// TODO: remove in React 17
249+
// TODO: remove in React 18
250250
if (!__EXPERIMENTAL__) {
251251
it('should support unstable_createPortal alias', () => {
252252
const portalContainer = document.createElement('div');
@@ -260,7 +260,7 @@ describe('ReactDOMFiber', () => {
260260
),
261261
).toWarnDev(
262262
'The ReactDOM.unstable_createPortal() alias has been deprecated, ' +
263-
'and will be removed in React 17+. Update your code to use ' +
263+
'and will be removed in React 18+. Update your code to use ' +
264264
'ReactDOM.createPortal() instead. It has the exact same API, ' +
265265
'but without the "unstable_" prefix.',
266266
{withoutStack: true},

packages/react-dom/src/__tests__/ReactRenderDocument-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ describe('rendering React components at document', () => {
3939
callback,
4040
).toWarnDev(
4141
'render(): Calling ReactDOM.render() to hydrate server-rendered markup ' +
42-
'will stop working in React v17. Replace the ReactDOM.render() call ' +
42+
'will stop working in React v18. Replace the ReactDOM.render() call ' +
4343
'with ReactDOM.hydrate() if you want React to attach to the server HTML.',
4444
{withoutStack: true},
4545
);
@@ -201,7 +201,7 @@ describe('rendering React components at document', () => {
201201
ReactDOM.render(<Component text="Hello world" />, testDocument),
202202
).toWarnDev(
203203
'render(): Calling ReactDOM.render() to hydrate server-rendered markup ' +
204-
'will stop working in React v17. Replace the ReactDOM.render() call ' +
204+
'will stop working in React v18. Replace the ReactDOM.render() call ' +
205205
'with ReactDOM.hydrate() if you want React to attach to the server HTML.',
206206
{withoutStack: true},
207207
);

packages/react-dom/src/__tests__/ReactServerRenderingHydration-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ describe('ReactDOMServerHydration', () => {
8383
instance = ReactDOM.render(<TestComponent name="x" />, element);
8484
}).toWarnDev(
8585
'render(): Calling ReactDOM.render() to hydrate server-rendered markup ' +
86-
'will stop working in React v17. Replace the ReactDOM.render() call ' +
86+
'will stop working in React v18. Replace the ReactDOM.render() call ' +
8787
'with ReactDOM.hydrate() if you want React to attach to the server HTML.',
8888
{withoutStack: true},
8989
);

packages/react-dom/src/__tests__/ReactUnmockedSchedulerWarning-test.internal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ it('should warn in legacy mode', () => {
3232
expect(() => {
3333
ReactDOM.render(<App />, document.createElement('div'));
3434
}).toErrorDev(
35-
['Starting from React v17, the "scheduler" module will need to be mocked'],
35+
['Starting from React v18, the "scheduler" module will need to be mocked'],
3636
{withoutStack: true},
3737
);
3838
// does not warn twice

packages/react-dom/src/client/ReactDOM.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ function unstable_createPortal(
164164
didWarnAboutUnstableCreatePortal = true;
165165
console.warn(
166166
'The ReactDOM.unstable_createPortal() alias has been deprecated, ' +
167-
'and will be removed in React 17+. Update your code to use ' +
167+
'and will be removed in React 18+. Update your code to use ' +
168168
'ReactDOM.createPortal() instead. It has the exact same API, ' +
169169
'but without the "unstable_" prefix.',
170170
);
@@ -210,7 +210,7 @@ export {
210210
renderSubtreeIntoContainer as unstable_renderSubtreeIntoContainer,
211211
// Disabled behind disableUnstableCreatePortal
212212
// Temporary alias since we already shipped React 16 RC with it.
213-
// TODO: remove in React 17.
213+
// TODO: remove in React 18.
214214
unstable_createPortal,
215215
// enableCreateEventHandleAPI
216216
createEventHandle as unstable_createEventHandle,

packages/react-dom/src/client/ReactDOMLegacy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ function legacyCreateRootFromDOMContainer(
143143
warnedAboutHydrateAPI = true;
144144
console.warn(
145145
'render(): Calling ReactDOM.render() to hydrate server-rendered markup ' +
146-
'will stop working in React v17. Replace the ReactDOM.render() call ' +
146+
'will stop working in React v18. Replace the ReactDOM.render() call ' +
147147
'with ReactDOM.hydrate() if you want React to attach to the server HTML.',
148148
);
149149
}

0 commit comments

Comments
 (0)