Load 'ReactFabric' only when it is required to render a Fabric component

Reviewed By: yungsters

Differential Revision: D7970603

fbshipit-source-id: 34676b9e174bc1e1141f4f435aa2c8e2b62cd5b9
This commit is contained in:
David Vacca 2018-05-11 17:09:14 -07:00 committed by Facebook Github Bot
parent b762f5293e
commit 75ff136f03
1 changed files with 2 additions and 4 deletions

View File

@ -12,8 +12,6 @@
const AppContainer = require('AppContainer');
const React = require('React');
const ReactFabric = require('ReactFabric');
const ReactNative = require('ReactNative');
const invariant = require('fbjs/lib/invariant');
@ -51,9 +49,9 @@ function renderApplication<Props: Object>(
}
if (fabric) {
ReactFabric.render(renderable, rootTag);
require('ReactFabric').render(renderable, rootTag);
} else {
ReactNative.render(renderable, rootTag);
require('ReactNative').render(renderable, rootTag);
}
}