Skip to content

Commit

Permalink
React sync for revisions 467b103...a634e53
Browse files Browse the repository at this point in the history
Reviewed By: flarnie

Differential Revision: D6965585

fbshipit-source-id: 48c20d0010f4daf83272a36b3bdaca94493ab8fa
  • Loading branch information
Brian Vaughn authored and facebook-github-bot committed Feb 12, 2018
1 parent f7729a5 commit bedaaa1
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Libraries/Renderer/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
467b1034ce8af6807e11deb9dfeca4d4e922ed82
a634e53d2ff376366aa87815ad4de064494cd05e
21 changes: 13 additions & 8 deletions Libraries/Renderer/ReactFabric-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
Expand All @@ -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) {
Expand Down Expand Up @@ -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") {
Expand Down
21 changes: 13 additions & 8 deletions Libraries/Renderer/ReactNativeRenderer-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
Expand All @@ -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) {
Expand Down Expand Up @@ -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") {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down

0 comments on commit bedaaa1

Please sign in to comment.