Skip to content

Commit 53a6927

Browse files
excedfacebook-github-bot
authored andcommitted
Remove SubscribableMixin from SizeFlexibilityUpdateTest (facebook#21580)
Summary: Related to facebook#21485 Remove SubscribableMixin from SizeFlexibilityUpdateTest - All flow tests succeed. - yarn run test-android-instrumentation && CI integration tests [GENERAL] [ENHANCEMENT] [SizeFlexibilityUpdateTest.js] - rm SubscribableMixin Pull Request resolved: facebook#21580 Reviewed By: TheSavior Differential Revision: D10276267 Pulled By: RSNara fbshipit-source-id: fc89b43099c788cba560c9aaf0819cd5cfab38c3
1 parent 748837d commit 53a6927

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

IntegrationTests/SizeFlexibilityUpdateTest.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* LICENSE file in the root directory of this source tree.
66
*
77
* @format
8+
* @flow
89
*/
910

1011
'use strict';
@@ -13,10 +14,10 @@ const React = require('react');
1314
const createReactClass = require('create-react-class');
1415
const ReactNative = require('react-native');
1516
const RCTNativeAppEventEmitter = require('RCTNativeAppEventEmitter');
16-
const Subscribable = require('Subscribable');
1717
const {View} = ReactNative;
1818

1919
const {TestModule} = ReactNative.NativeModules;
20+
import type EmitterSubscription from 'EmitterSubscription';
2021

2122
const reactViewWidth = 111;
2223
const reactViewHeight = 222;
@@ -25,16 +26,21 @@ let finalState = false;
2526

2627
const SizeFlexibilityUpdateTest = createReactClass({
2728
displayName: 'SizeFlexibilityUpdateTest',
28-
mixins: [Subscribable.Mixin],
29+
_subscription: (null: ?EmitterSubscription),
2930

3031
UNSAFE_componentWillMount: function() {
31-
this.addListenerOn(
32-
RCTNativeAppEventEmitter,
32+
this._subscription = RCTNativeAppEventEmitter.addListener(
3333
'rootViewDidChangeIntrinsicSize',
3434
this.rootViewDidChangeIntrinsicSize,
3535
);
3636
},
3737

38+
componentWillUnmount: function() {
39+
if (this._subscription != null) {
40+
this._subscription.remove();
41+
}
42+
},
43+
3844
markPassed: function() {
3945
TestModule.markTestPassed(true);
4046
finalState = true;

0 commit comments

Comments
 (0)