diff --git a/Libraries/Renderer/REVISION b/Libraries/Renderer/REVISION index 981ea0ea49..fe141ab809 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 475dd17d22..f3ef96ccd7 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 15ee4136d1..e562e89af0 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 92be465f9c..22ecc1725b 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" }