[RN] Remove unstable_batchedUpdates and unmountComponentAtNodeAndRemoveContainer from Fabric (#12571)
These don't make much sense in Fabric, since Fabric will be async by default only. And unmount+remove container is a sketchy API we should remove so we might as well make sure modern containers enforce that.
Sebastian Markbåge committed
Apr 9, 2018 at 19:36 UTC
40d07724fcc801ad69e17b295b68ebea753d5977
2 files changed
+15
-8
packages/react-native-renderer/src/ReactFabric.js
+2
-8
@@ -7,7 +7,7 @@
7
* @flow
8
*/
9
10
-import type {ReactNativeType} from './ReactNativeTypes';
10
+import type {ReactFabricType} from './ReactNativeTypes';
11
import type {ReactNodeList} from 'shared/ReactTypes';
12
13
import './ReactFabricInjection';
@@ -32,7 +32,7 @@ ReactGenericBatching.injection.injectRenderer(ReactFabricRenderer);
32
33
const roots = new Map();
34
35
-const ReactFabric: ReactNativeType = {
35
+const ReactFabric: ReactFabricType = {
36
NativeComponent: ReactNativeComponent,
37
38
findNodeHandle: findNumericNodeHandle,
@@ -61,10 +61,6 @@ const ReactFabric: ReactNativeType = {
61
}
62
},
63
64
- unmountComponentAtNodeAndRemoveContainer(containerTag: number) {
65
- ReactFabric.unmountComponentAtNode(containerTag);
66
- },
67
-
64
createPortal(
65
children: ReactNodeList,
66
containerTag: number,
@@ -73,8 +69,6 @@ const ReactFabric: ReactNativeType = {
69
return ReactPortal.createPortal(children, containerTag, null, key);
70
},
71
76
- unstable_batchedUpdates: ReactGenericBatching.batchedUpdates,
77
-
72
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
73
// Used as a mixin in many createClass-based components
74
NativeMethodsMixin,
packages/react-native-renderer/src/ReactNativeTypes.js
+13
@@ -103,3 +103,16 @@ export type ReactNativeType = {
103
104
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: SecretInternalsType,
105
};
106
+
107
+export type ReactFabricType = {
108
+ NativeComponent: any,
109
+ findNodeHandle(componentOrHandle: any): ?number,
110
+ render(
111
+ element: React$Element<any>,
112
+ containerTag: any,
113
+ callback: ?Function,
114
+ ): any,
115
+ unmountComponentAtNode(containerTag: number): any,
116
+
117
+ __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: SecretInternalsType,
118
+};