Skip to content

Commit

Permalink
[RN] Remove unstable_batchedUpdates and unmountComponentAtNodeAndRemo…
Browse files Browse the repository at this point in the history
…veContainer from Fabric (facebook#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.
  • Loading branch information
sebmarkbage authored and rhagigi committed Apr 19, 2018
1 parent f82e3fe commit 725cdb8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
10 changes: 2 additions & 8 deletions packages/react-native-renderer/src/ReactFabric.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @flow
*/

import type {ReactNativeType} from './ReactNativeTypes';
import type {ReactFabricType} from './ReactNativeTypes';
import type {ReactNodeList} from 'shared/ReactTypes';

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

const roots = new Map();

const ReactFabric: ReactNativeType = {
const ReactFabric: ReactFabricType = {
NativeComponent: ReactNativeComponent,

findNodeHandle: findNumericNodeHandle,
Expand Down Expand Up @@ -61,10 +61,6 @@ const ReactFabric: ReactNativeType = {
}
},

unmountComponentAtNodeAndRemoveContainer(containerTag: number) {
ReactFabric.unmountComponentAtNode(containerTag);
},

createPortal(
children: ReactNodeList,
containerTag: number,
Expand All @@ -73,8 +69,6 @@ const ReactFabric: ReactNativeType = {
return ReactPortal.createPortal(children, containerTag, null, key);
},

unstable_batchedUpdates: ReactGenericBatching.batchedUpdates,

__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
// Used as a mixin in many createClass-based components
NativeMethodsMixin,
Expand Down
13 changes: 13 additions & 0 deletions packages/react-native-renderer/src/ReactNativeTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,16 @@ export type ReactNativeType = {

__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: SecretInternalsType,
};

export type ReactFabricType = {
NativeComponent: any,
findNodeHandle(componentOrHandle: any): ?number,
render(
element: React$Element<any>,
containerTag: any,
callback: ?Function,
): any,
unmountComponentAtNode(containerTag: number): any,

__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: SecretInternalsType,
};

0 comments on commit 725cdb8

Please sign in to comment.