Remove SubscribableMixin from SizeFlexibilityUpdateTest (#21580)

Summary:
Related to #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: https://github.com/facebook/react-native/pull/21580

Reviewed By: TheSavior

Differential Revision: D10276267

Pulled By: RSNara

fbshipit-source-id: fc89b43099c788cba560c9aaf0819cd5cfab38c3
This commit is contained in:
Thomas BARRAS 2018-10-10 08:50:10 -07:00 committed by Facebook Github Bot
parent 4b6f02ea75
commit 4b8c6573f2
1 changed files with 10 additions and 4 deletions

View File

@ -5,6 +5,7 @@
* LICENSE file in the root directory of this source tree.
*
* @format
* @flow
*/
'use strict';
@ -13,10 +14,10 @@ const React = require('react');
const createReactClass = require('create-react-class');
const ReactNative = require('react-native');
const RCTNativeAppEventEmitter = require('RCTNativeAppEventEmitter');
const Subscribable = require('Subscribable');
const {View} = ReactNative;
const {TestModule} = ReactNative.NativeModules;
import type EmitterSubscription from 'EmitterSubscription';
const reactViewWidth = 111;
const reactViewHeight = 222;
@ -25,16 +26,21 @@ let finalState = false;
const SizeFlexibilityUpdateTest = createReactClass({
displayName: 'SizeFlexibilityUpdateTest',
mixins: [Subscribable.Mixin],
_subscription: (null: ?EmitterSubscription),
UNSAFE_componentWillMount: function() {
this.addListenerOn(
RCTNativeAppEventEmitter,
this._subscription = RCTNativeAppEventEmitter.addListener(
'rootViewDidChangeIntrinsicSize',
this.rootViewDidChangeIntrinsicSize,
);
},
componentWillUnmount: function() {
if (this._subscription != null) {
this._subscription.remove();
}
},
markPassed: function() {
TestModule.markTestPassed(true);
finalState = true;