diff --git a/Examples/UIExplorer/ExampleTypes.js b/Examples/UIExplorer/ExampleTypes.js index 44db06a6c..ac9deaadf 100644 --- a/Examples/UIExplorer/ExampleTypes.js +++ b/Examples/UIExplorer/ExampleTypes.js @@ -14,11 +14,13 @@ * @providesModule ExampleTypes * @flow */ +'use strict'; export type Example = { title: string, render: () => ?ReactElement, description?: string, + platform?: string; }; export type ExampleModule = { diff --git a/Examples/UIExplorer/createExamplePage.js b/Examples/UIExplorer/createExamplePage.js index 86525c485..410688160 100644 --- a/Examples/UIExplorer/createExamplePage.js +++ b/Examples/UIExplorer/createExamplePage.js @@ -17,6 +17,9 @@ 'use strict'; var React = require('react-native'); +var { + Platform, +} = React; var ReactNative = require('ReactNative'); var UIExplorerBlock = require('./UIExplorerBlock'); var UIExplorerPage = require('./UIExplorerPage'); @@ -36,6 +39,12 @@ var createExamplePage = function(title: ?string, exampleModule: ExampleModule) }, getBlock: function(example: Example, i) { + if (example.platform) { + if (Platform.OS !== example.platform) { + return; + } + example.title += ' (' + example.platform + ' only)'; + } // Hack warning: This is a hack because the www UI explorer requires // renderComponent to be called. var originalRender = React.render;