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:
Sebastian Markbage 2016-04-07 21:13:12 -07:00 committed by Facebook Github Bot 3
parent 613ca14612
commit 528cf68fa0
4 changed files with 14 additions and 18 deletions

View File

@ -16,12 +16,13 @@
*/ */
'use strict'; 'use strict';
var React = require('react-native'); var React = require('react');
var ReactNative = require('react-native');
var { var {
StyleSheet, StyleSheet,
Text, Text,
View, View,
} = React; } = ReactNative;
var UIExplorerBlock = React.createClass({ var UIExplorerBlock = React.createClass({
propTypes: { propTypes: {

View File

@ -16,12 +16,13 @@
*/ */
'use strict'; 'use strict';
var React = require('react-native'); var React = require('react');
var ReactNative = require('react-native');
var { var {
ScrollView, ScrollView,
StyleSheet, StyleSheet,
View, View,
} = React; } = ReactNative;
var UIExplorerTitle = require('./UIExplorerTitle'); var UIExplorerTitle = require('./UIExplorerTitle');

View File

@ -16,12 +16,13 @@
*/ */
'use strict'; 'use strict';
var React = require('react-native'); var React = require('react');
var ReactNative = require('react-native');
var { var {
StyleSheet, StyleSheet,
Text, Text,
View, View,
} = React; } = ReactNative;
var UIExplorerTitle = React.createClass({ var UIExplorerTitle = React.createClass({
render: function() { render: function() {

View File

@ -16,11 +16,11 @@
*/ */
'use strict'; 'use strict';
var React = require('react-native'); var React = require('react');
var ReactNative = require('react-native');
var { var {
Platform, Platform,
} = React; } = ReactNative;
var ReactNative = require('ReactNative');
var UIExplorerBlock = require('./UIExplorerBlock'); var UIExplorerBlock = require('./UIExplorerBlock');
var UIExplorerPage = require('./UIExplorerPage'); var UIExplorerPage = require('./UIExplorerPage');
@ -47,20 +47,15 @@ var createExamplePage = function(title: ?string, exampleModule: ExampleModule)
} }
title += ' (' + platform + ' only)'; title += ' (' + platform + ' only)';
} }
// Hack warning: This is a hack because the www UI explorer requires // Hack warning: This is a hack because the www UI explorer used to
// renderComponent to be called. // require render to be called. It should just return elements now.
var originalRender = React.render; 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 originalIOSRender = ReactNative.render;
var originalIOSRenderComponent = ReactNative.renderComponent;
var renderedComponent; var renderedComponent;
// TODO remove typecasts when Flow bug #6560135 is fixed // TODO remove typecasts when Flow bug #6560135 is fixed
// and workaround is removed from react-native.js // and workaround is removed from react-native.js
(React: Object).render = (React: Object).render =
(React: Object).renderComponent =
(ReactNative: Object).render = (ReactNative: Object).render =
(ReactNative: Object).renderComponent =
function(element, container) { function(element, container) {
renderedComponent = element; renderedComponent = element;
}; };
@ -71,9 +66,7 @@ var createExamplePage = function(title: ?string, exampleModule: ExampleModule)
}); });
} }
(React: Object).render = originalRender; (React: Object).render = originalRender;
(React: Object).renderComponent = originalRenderComponent;
(ReactNative: Object).render = originalIOSRender; (ReactNative: Object).render = originalIOSRender;
(ReactNative: Object).renderComponent = originalIOSRenderComponent;
return ( return (
<UIExplorerBlock <UIExplorerBlock
key={i} key={i}