From bedaaa1419aa31fabf6dbf7a7f5ad294af1f4b5e Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Mon, 12 Feb 2018 13:57:50 -0800 Subject: [PATCH] React sync for revisions 467b103...a634e53 Reviewed By: flarnie Differential Revision: D6965585 fbshipit-source-id: 48c20d0010f4daf83272a36b3bdaca94493ab8fa --- Libraries/Renderer/REVISION | 2 +- Libraries/Renderer/ReactFabric-dev.js | 21 ++++++++++++------- Libraries/Renderer/ReactNativeRenderer-dev.js | 21 ++++++++++++------- package.json | 4 ++-- 4 files changed, 29 insertions(+), 19 deletions(-) diff --git a/Libraries/Renderer/REVISION b/Libraries/Renderer/REVISION index 981ea0ea4..fe141ab80 100644 --- a/Libraries/Renderer/REVISION +++ b/Libraries/Renderer/REVISION @@ -1 +1 @@ -467b1034ce8af6807e11deb9dfeca4d4e922ed82 \ No newline at end of file +a634e53d2ff376366aa87815ad4de064494cd05e \ No newline at end of file diff --git a/Libraries/Renderer/ReactFabric-dev.js b/Libraries/Renderer/ReactFabric-dev.js index 475dd17d2..f3ef96ccd 100644 --- a/Libraries/Renderer/ReactFabric-dev.js +++ b/Libraries/Renderer/ReactFabric-dev.js @@ -3881,6 +3881,8 @@ var NativeMethodsMixin = { !NativeMethodsMixin_DEV.UNSAFE_componentWillReceiveProps, "Do not override existing functions." ); + // TODO (bvaughn) Remove cWM and cWRP in a future version of React Native, + // Once these lifecycles have been remove from the reconciler. NativeMethodsMixin_DEV.componentWillMount = function() { throwOnStylesProp(this, this.props); }; @@ -3893,6 +3895,12 @@ var NativeMethodsMixin = { NativeMethodsMixin_DEV.UNSAFE_componentWillReceiveProps = function(newProps) { throwOnStylesProp(this, newProps); }; + + // React may warn about cWM/cWRP/cWU methods being deprecated. + // Add a flag to suppress these warnings for this special case. + // TODO (bvaughn) Remove this flag once the above methods have been removed. + NativeMethodsMixin_DEV.componentWillMount.__suppressDeprecationWarning = true; + NativeMethodsMixin_DEV.componentWillReceiveProps.__suppressDeprecationWarning = true; } function _classCallCheck$1(instance, Constructor) { @@ -6008,19 +6016,16 @@ var ReactStrictModeWarnings = { } // Don't warn about react-lifecycles-compat polyfilled components. - // Note that it is sufficient to check for the presence of a - // single lifecycle, componentWillMount, with the polyfill flag. if ( typeof instance.componentWillMount === "function" && - instance.componentWillMount.__suppressDeprecationWarning === true + instance.componentWillMount.__suppressDeprecationWarning !== true ) { - return; - } - - if (typeof instance.componentWillMount === "function") { pendingComponentWillMountWarnings.push(fiber); } - if (typeof instance.componentWillReceiveProps === "function") { + if ( + typeof instance.componentWillReceiveProps === "function" && + instance.componentWillReceiveProps.__suppressDeprecationWarning !== true + ) { pendingComponentWillReceivePropsWarnings.push(fiber); } if (typeof instance.componentWillUpdate === "function") { diff --git a/Libraries/Renderer/ReactNativeRenderer-dev.js b/Libraries/Renderer/ReactNativeRenderer-dev.js index 15ee4136d..e562e89af 100644 --- a/Libraries/Renderer/ReactNativeRenderer-dev.js +++ b/Libraries/Renderer/ReactNativeRenderer-dev.js @@ -3881,6 +3881,8 @@ var NativeMethodsMixin = { !NativeMethodsMixin_DEV.UNSAFE_componentWillReceiveProps, "Do not override existing functions." ); + // TODO (bvaughn) Remove cWM and cWRP in a future version of React Native, + // Once these lifecycles have been remove from the reconciler. NativeMethodsMixin_DEV.componentWillMount = function() { throwOnStylesProp(this, this.props); }; @@ -3893,6 +3895,12 @@ var NativeMethodsMixin = { NativeMethodsMixin_DEV.UNSAFE_componentWillReceiveProps = function(newProps) { throwOnStylesProp(this, newProps); }; + + // React may warn about cWM/cWRP/cWU methods being deprecated. + // Add a flag to suppress these warnings for this special case. + // TODO (bvaughn) Remove this flag once the above methods have been removed. + NativeMethodsMixin_DEV.componentWillMount.__suppressDeprecationWarning = true; + NativeMethodsMixin_DEV.componentWillReceiveProps.__suppressDeprecationWarning = true; } function _classCallCheck$1(instance, Constructor) { @@ -5919,19 +5927,16 @@ var ReactStrictModeWarnings = { } // Don't warn about react-lifecycles-compat polyfilled components. - // Note that it is sufficient to check for the presence of a - // single lifecycle, componentWillMount, with the polyfill flag. if ( typeof instance.componentWillMount === "function" && - instance.componentWillMount.__suppressDeprecationWarning === true + instance.componentWillMount.__suppressDeprecationWarning !== true ) { - return; - } - - if (typeof instance.componentWillMount === "function") { pendingComponentWillMountWarnings.push(fiber); } - if (typeof instance.componentWillReceiveProps === "function") { + if ( + typeof instance.componentWillReceiveProps === "function" && + instance.componentWillReceiveProps.__suppressDeprecationWarning !== true + ) { pendingComponentWillReceivePropsWarnings.push(fiber); } if (typeof instance.componentWillUpdate === "function") { diff --git a/package.json b/package.json index 92be465f9..22ecc1725 100644 --- a/package.json +++ b/package.json @@ -219,8 +219,8 @@ "jest": "22.2.1", "jest-junit": "3.5.0", "prettier": "1.9.1", - "react": "^16.3.0-alpha.0", - "react-test-renderer": "^16.3.0-alpha.0", + "react": "^16.3.0-alpha.1", + "react-test-renderer": "^16.3.0-alpha.1", "shelljs": "^0.7.8", "sinon": "^2.2.0" }