mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-17 19:33:12 +08:00
Fix warnings in UIExplorer example pages
Summary:Update to new package split syntax + updated ReactART to a version that has isomorphic rendering. D3154320. Reviewed By: spicyj Differential Revision: D3154434 fb-gh-sync-id: 7cfae5582de9040f10f5637c8c470310f42398f3 fbshipit-source-id: 7cfae5582de9040f10f5637c8c470310f42398f3
This commit is contained in:
committed by
Facebook Github Bot 3
parent
613ca14612
commit
528cf68fa0
@@ -16,11 +16,11 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
var React = require('react-native');
|
||||
var React = require('react');
|
||||
var ReactNative = require('react-native');
|
||||
var {
|
||||
Platform,
|
||||
} = React;
|
||||
var ReactNative = require('ReactNative');
|
||||
} = ReactNative;
|
||||
var UIExplorerBlock = require('./UIExplorerBlock');
|
||||
var UIExplorerPage = require('./UIExplorerPage');
|
||||
|
||||
@@ -47,20 +47,15 @@ var createExamplePage = function(title: ?string, exampleModule: ExampleModule)
|
||||
}
|
||||
title += ' (' + platform + ' only)';
|
||||
}
|
||||
// Hack warning: This is a hack because the www UI explorer requires
|
||||
// renderComponent to be called.
|
||||
// Hack warning: This is a hack because the www UI explorer used to
|
||||
// require render to be called. It should just return elements now.
|
||||
var originalRender = React.render;
|
||||
// $FlowFixMe React.renderComponent was deprecated in 0.12, should this be React.render?
|
||||
var originalRenderComponent = React.renderComponent;
|
||||
var originalIOSRender = ReactNative.render;
|
||||
var originalIOSRenderComponent = ReactNative.renderComponent;
|
||||
var renderedComponent;
|
||||
// TODO remove typecasts when Flow bug #6560135 is fixed
|
||||
// and workaround is removed from react-native.js
|
||||
(React: Object).render =
|
||||
(React: Object).renderComponent =
|
||||
(ReactNative: Object).render =
|
||||
(ReactNative: Object).renderComponent =
|
||||
function(element, container) {
|
||||
renderedComponent = element;
|
||||
};
|
||||
@@ -71,9 +66,7 @@ var createExamplePage = function(title: ?string, exampleModule: ExampleModule)
|
||||
});
|
||||
}
|
||||
(React: Object).render = originalRender;
|
||||
(React: Object).renderComponent = originalRenderComponent;
|
||||
(ReactNative: Object).render = originalIOSRender;
|
||||
(ReactNative: Object).renderComponent = originalIOSRenderComponent;
|
||||
return (
|
||||
<UIExplorerBlock
|
||||
key={i}
|
||||
|
||||
Reference in New Issue
Block a user