diff --git a/Examples/UIExplorer/UIExplorerApp.ios.js b/Examples/UIExplorer/UIExplorerApp.ios.js index c2f4734e8..8daecbd42 100644 --- a/Examples/UIExplorer/UIExplorerApp.ios.js +++ b/Examples/UIExplorer/UIExplorerApp.ios.js @@ -73,5 +73,6 @@ var styles = StyleSheet.create({ }); AppRegistry.registerComponent('UIExplorerApp', () => UIExplorerApp); +UIExplorerList.registerComponents(); module.exports = UIExplorerApp; diff --git a/Examples/UIExplorer/UIExplorerList.ios.js b/Examples/UIExplorer/UIExplorerList.ios.js index c56bed0fd..c8f07d971 100644 --- a/Examples/UIExplorer/UIExplorerList.ios.js +++ b/Examples/UIExplorer/UIExplorerList.ios.js @@ -79,23 +79,6 @@ var APIS = [ require('./ImageEditingExample'), ]; -// Register suitable examples for snapshot tests -COMPONENTS.concat(APIS).forEach((Example) => { - if (Example.displayName) { - var Snapshotter = React.createClass({ - render: function() { - var Renderable = UIExplorerListBase.makeRenderable(Example); - return ( - - - - ); - }, - }); - AppRegistry.registerComponent(Example.displayName, () => Snapshotter); - } -}); - type Props = { navigator: { navigationContext: NavigationContext, @@ -144,6 +127,25 @@ class UIExplorerList extends React.Component { onPressRow(example: any) { this._openExample(example); } + + // Register suitable examples for snapshot tests + static registerComponents() { + COMPONENTS.concat(APIS).forEach((Example) => { + if (Example.displayName) { + var Snapshotter = React.createClass({ + render: function() { + var Renderable = UIExplorerListBase.makeRenderable(Example); + return ( + + + + ); + }, + }); + AppRegistry.registerComponent(Example.displayName, () => Snapshotter); + } + }); + } } var styles = StyleSheet.create({