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:
parent
613ca14612
commit
528cf68fa0
|
@ -16,12 +16,13 @@
|
|||
*/
|
||||
'use strict';
|
||||
|
||||
var React = require('react-native');
|
||||
var React = require('react');
|
||||
var ReactNative = require('react-native');
|
||||
var {
|
||||
StyleSheet,
|
||||
Text,
|
||||
View,
|
||||
} = React;
|
||||
} = ReactNative;
|
||||
|
||||
var UIExplorerBlock = React.createClass({
|
||||
propTypes: {
|
||||
|
|
|
@ -16,12 +16,13 @@
|
|||
*/
|
||||
'use strict';
|
||||
|
||||
var React = require('react-native');
|
||||
var React = require('react');
|
||||
var ReactNative = require('react-native');
|
||||
var {
|
||||
ScrollView,
|
||||
StyleSheet,
|
||||
View,
|
||||
} = React;
|
||||
} = ReactNative;
|
||||
|
||||
var UIExplorerTitle = require('./UIExplorerTitle');
|
||||
|
||||
|
|
|
@ -16,12 +16,13 @@
|
|||
*/
|
||||
'use strict';
|
||||
|
||||
var React = require('react-native');
|
||||
var React = require('react');
|
||||
var ReactNative = require('react-native');
|
||||
var {
|
||||
StyleSheet,
|
||||
Text,
|
||||
View,
|
||||
} = React;
|
||||
} = ReactNative;
|
||||
|
||||
var UIExplorerTitle = React.createClass({
|
||||
render: function() {
|
||||
|
|
|
@ -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}
|
||||
|
|
Loading…
Reference in New Issue