mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-27 06:12:24 +08:00
Unforked renderApplication()
Summary: This allows toggling fabric renderer via the same renderApplication() Reviewed By: mdvacca Differential Revision: D7682524 fbshipit-source-id: 59be1d2bea15f5e13e64e2d72304d79f9cb7d084
This commit is contained in:
committed by
Facebook Github Bot
parent
dc836780cb
commit
60b05133ba
@@ -13,6 +13,7 @@
|
||||
|
||||
const AppContainer = require('AppContainer');
|
||||
const React = require('React');
|
||||
const ReactFabric = require('ReactFabric');
|
||||
const ReactNative = require('ReactNative');
|
||||
|
||||
const invariant = require('fbjs/lib/invariant');
|
||||
@@ -25,6 +26,7 @@ function renderApplication<Props: Object>(
|
||||
initialProps: Props,
|
||||
rootTag: any,
|
||||
WrapperComponent?: ?React.ComponentType<*>,
|
||||
fabric?: boolean,
|
||||
) {
|
||||
invariant(rootTag, 'Expect to have a valid rootTag, instead got ', rootTag);
|
||||
|
||||
@@ -49,7 +51,11 @@ function renderApplication<Props: Object>(
|
||||
renderable = <AsyncMode>{renderable}</AsyncMode>;
|
||||
}
|
||||
|
||||
ReactNative.render(renderable, rootTag);
|
||||
if (fabric) {
|
||||
ReactFabric.render(renderable, rootTag);
|
||||
} else {
|
||||
ReactNative.render(renderable, rootTag);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = renderApplication;
|
||||
|
||||
Reference in New Issue
Block a user