Skip to content

Commit

Permalink
React 16 beta 5 sync (5495e49...c3718c4)
Browse files Browse the repository at this point in the history
Reviewed By: spicyj

Differential Revision: D5564030

fbshipit-source-id: fd3e6133df7ee8e7488a3c515ce6c783c11d9401
  • Loading branch information
Brian Vaughn authored and facebook-github-bot committed Aug 9, 2017
1 parent b1bb0a7 commit 046f600
Show file tree
Hide file tree
Showing 8 changed files with 11,659 additions and 11,989 deletions.
5 changes: 4 additions & 1 deletion Libraries/Animated/src/AnimatedImplementation.js
Expand Up @@ -1760,6 +1760,8 @@ function createAnimatedComponent(Component: any): any {
_eventDetachers: Array<Function> = [];
_setComponentRef: Function;

static __skipSetNativeProps_FOR_TESTS_ONLY = false;

constructor(props: Object) {
super(props);
this._setComponentRef = this._setComponentRef.bind(this);
Expand Down Expand Up @@ -1814,7 +1816,8 @@ function createAnimatedComponent(Component: any): any {
// need to re-render it. In this case, we have a fallback that uses
// forceUpdate.
var callback = () => {
if (this._component.setNativeProps) {
if (!AnimatedComponent.__skipSetNativeProps_FOR_TESTS_ONLY &&
this._component.setNativeProps) {
if (!this._propsAnimated.__isNative) {
this._component.setNativeProps(
this._propsAnimated.__getAnimatedValue()
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Renderer/REVISION
@@ -1 +1 @@
5495e495de0bd15cd96a76ee0d7ca823cc09cc71
c3718c48f01fa6c2e04bd47226061769484c951b
8,684 changes: 4,249 additions & 4,435 deletions Libraries/Renderer/ReactNativeFiber-dev.js

Large diffs are not rendered by default.

5,931 changes: 2,987 additions & 2,944 deletions Libraries/Renderer/ReactNativeFiber-prod.js

Large diffs are not rendered by default.

6,134 changes: 2,945 additions & 3,189 deletions Libraries/Renderer/ReactNativeStack-dev.js

Large diffs are not rendered by default.

2,846 changes: 1,431 additions & 1,415 deletions Libraries/Renderer/ReactNativeStack-prod.js

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions jest/setup.js
Expand Up @@ -68,6 +68,44 @@ jest
};
return DataSource;
})
.mock('AnimatedImplementation', () => {
const AnimatedImplementation = require.requireActual('AnimatedImplementation');
const oldCreate = AnimatedImplementation.createAnimatedComponent;
AnimatedImplementation.createAnimatedComponent = function(Component) {
const Wrapped = oldCreate(Component);
Wrapped.__skipSetNativeProps_FOR_TESTS_ONLY = true;
return Wrapped;
};
return AnimatedImplementation;
})
.mock('ReactNative', () => {
const ReactNative = require.requireActual('ReactNative');
const NativeMethodsMixin =
ReactNative.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.NativeMethodsMixin;
[
'measure',
'measureInWindow',
'measureLayout',
'setNativeProps',
'focus',
'blur',
].forEach((key) => {
let warned = false;
NativeMethodsMixin[key] = function() {
if (warned) {
return;
}
warned = true;
console.warn(
'Calling .' + key + '() in the test renderer environment is not ' +
'supported. Instead, mock out your components that use ' +
'findNodeHandle with replacements that don\'t rely on the ' +
'native environment.',
);
};
});
return ReactNative;
})
.mock('ensureComponentIsNative', () => () => true);

const mockEmptyObject = {};
Expand Down
8 changes: 4 additions & 4 deletions package.json
Expand Up @@ -133,7 +133,7 @@
"react-native": "local-cli/wrong-react-native.js"
},
"peerDependencies": {
"react": "16.0.0-alpha.12"
"react": "16.0.0-beta.5"
},
"dependencies": {
"absolute-path": "^0.0.0",
Expand All @@ -155,7 +155,7 @@
"denodeify": "^1.2.1",
"envinfo": "^3.0.0",
"event-target-shim": "^1.0.5",
"fbjs": "0.8.12",
"fbjs": "0.8.14",
"fbjs-scripts": "^0.8.1",
"fs-extra": "^1.0.0",
"glob": "^7.1.1",
Expand Down Expand Up @@ -202,8 +202,8 @@
"jest": "20.1.0-delta.4",
"mock-fs": "^4.4.1",
"prettier": "1.5.2",
"react": "16.0.0-alpha.12",
"react-test-renderer": "16.0.0-alpha.12",
"react": "16.0.0-beta.5",
"react-test-renderer": "16.0.0-beta.5",
"shelljs": "0.6.0",
"sinon": "^2.2.0"
}
Expand Down

0 comments on commit 046f600

Please sign in to comment.