Default empty view to RCTView with position: absolute

Reviewed By: spicyj, davidaurelio

Differential Revision: D2693494

fb-gh-sync-id: fc00b995d7d4fdaaedf4c3e5382354f0a1f4ac23
This commit is contained in:
Pieter De Baets 2015-11-26 07:13:16 -08:00 committed by facebook-github-bot-7
parent c0f60d2018
commit bb11e05c33
1 changed files with 10 additions and 8 deletions

View File

@ -23,6 +23,7 @@ var EventPluginUtils = require('EventPluginUtils');
var IOSDefaultEventPluginOrder = require('IOSDefaultEventPluginOrder');
var IOSNativeBridgeEventPlugin = require('IOSNativeBridgeEventPlugin');
var NodeHandle = require('NodeHandle');
var ReactElement = require('ReactElement');
var ReactComponentEnvironment = require('ReactComponentEnvironment');
var ReactDefaultBatchingStrategy = require('ReactDefaultBatchingStrategy');
var ReactEmptyComponent = require('ReactEmptyComponent');
@ -37,7 +38,6 @@ var ReactUpdates = require('ReactUpdates');
var ResponderEventPlugin = require('ResponderEventPlugin');
var UniversalWorkerNodeHandle = require('UniversalWorkerNodeHandle');
var createReactNativeComponentClass = require('createReactNativeComponentClass');
var invariant = require('invariant');
// Just to ensure this gets packaged, since its only caller is from Native.
@ -81,13 +81,15 @@ function inject() {
ReactNativeComponentEnvironment
);
// Can't import View here because it depends on React to make its composite
var RCTView = createReactNativeComponentClass({
validAttributes: {},
uiViewClassName: 'RCTView',
});
// TODO #9121531: make this position: absolute; by default, to avoid interfering with flexbox
ReactEmptyComponent.injection.injectEmptyComponent(RCTView);
var EmptyComponent = () => {
// Can't import View at the top because it depends on React to make its composite
var View = require('View');
return ReactElement.createElement(View, {
collapsable: true,
style: { position: 'absolute' }
});
};
ReactEmptyComponent.injection.injectEmptyComponent(EmptyComponent);
EventPluginUtils.injection.injectMount(ReactNativeMount);