mirror of
https://github.com/status-im/react-native.git
synced 2025-01-13 19:15:05 +00:00
React 16 beta 5 sync (5495e49...c3718c4)
Reviewed By: spicyj Differential Revision: D5564030 fbshipit-source-id: fd3e6133df7ee8e7488a3c515ce6c783c11d9401
This commit is contained in:
parent
b1bb0a71d5
commit
046f600cc2
@ -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);
|
||||
@ -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()
|
||||
|
@ -1 +1 @@
|
||||
5495e495de0bd15cd96a76ee0d7ca823cc09cc71
|
||||
c3718c48f01fa6c2e04bd47226061769484c951b
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -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 = {};
|
||||
|
@ -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",
|
||||
@ -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",
|
||||
@ -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"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user