Skip to content

Commit 40d0772

Browse files
authored
[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.
1 parent 933f882 commit 40d0772

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

packages/react-native-renderer/src/ReactFabric.js

+2-8
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @flow
88
*/
99

10-
import type {ReactNativeType} from './ReactNativeTypes';
10+
import type {ReactFabricType} from './ReactNativeTypes';
1111
import type {ReactNodeList} from 'shared/ReactTypes';
1212

1313
import './ReactFabricInjection';
@@ -32,7 +32,7 @@ ReactGenericBatching.injection.injectRenderer(ReactFabricRenderer);
3232

3333
const roots = new Map();
3434

35-
const ReactFabric: ReactNativeType = {
35+
const ReactFabric: ReactFabricType = {
3636
NativeComponent: ReactNativeComponent,
3737

3838
findNodeHandle: findNumericNodeHandle,
@@ -61,10 +61,6 @@ const ReactFabric: ReactNativeType = {
6161
}
6262
},
6363

64-
unmountComponentAtNodeAndRemoveContainer(containerTag: number) {
65-
ReactFabric.unmountComponentAtNode(containerTag);
66-
},
67-
6864
createPortal(
6965
children: ReactNodeList,
7066
containerTag: number,
@@ -73,8 +69,6 @@ const ReactFabric: ReactNativeType = {
7369
return ReactPortal.createPortal(children, containerTag, null, key);
7470
},
7571

76-
unstable_batchedUpdates: ReactGenericBatching.batchedUpdates,
77-
7872
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
7973
// Used as a mixin in many createClass-based components
8074
NativeMethodsMixin,

packages/react-native-renderer/src/ReactNativeTypes.js

+13
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,16 @@ export type ReactNativeType = {
103103

104104
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: SecretInternalsType,
105105
};
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+
};

0 commit comments

Comments
 (0)