From 528cf68fa0794614c28f3194daa69d645753204d Mon Sep 17 00:00:00 2001 From: Sebastian Markbage Date: Thu, 7 Apr 2016 21:13:12 -0700 Subject: [PATCH] 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 --- Examples/UIExplorer/UIExplorerBlock.js | 5 +++-- Examples/UIExplorer/UIExplorerPage.js | 5 +++-- Examples/UIExplorer/UIExplorerTitle.js | 5 +++-- Examples/UIExplorer/createExamplePage.js | 17 +++++------------ 4 files changed, 14 insertions(+), 18 deletions(-) diff --git a/Examples/UIExplorer/UIExplorerBlock.js b/Examples/UIExplorer/UIExplorerBlock.js index 649b8994ff0..9a3c7a5498c 100644 --- a/Examples/UIExplorer/UIExplorerBlock.js +++ b/Examples/UIExplorer/UIExplorerBlock.js @@ -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: { diff --git a/Examples/UIExplorer/UIExplorerPage.js b/Examples/UIExplorer/UIExplorerPage.js index 14bf2bed010..3aaf4119cf9 100644 --- a/Examples/UIExplorer/UIExplorerPage.js +++ b/Examples/UIExplorer/UIExplorerPage.js @@ -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'); diff --git a/Examples/UIExplorer/UIExplorerTitle.js b/Examples/UIExplorer/UIExplorerTitle.js index 165249893e8..81a74dc2798 100644 --- a/Examples/UIExplorer/UIExplorerTitle.js +++ b/Examples/UIExplorer/UIExplorerTitle.js @@ -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() { diff --git a/Examples/UIExplorer/createExamplePage.js b/Examples/UIExplorer/createExamplePage.js index 3d1d57898c6..72a9bc685f9 100644 --- a/Examples/UIExplorer/createExamplePage.js +++ b/Examples/UIExplorer/createExamplePage.js @@ -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 (