Use requireNativeComponent in website landing page example.

This commit is contained in:
Spencer Ahrens 2015-04-22 14:44:37 -07:00
parent 8529b7bd6a
commit bd165e86e1

View File

@ -226,10 +226,20 @@ RCT_EXPORT_VIEW_PROPERTY(myCustomProperty);
<Prism> <Prism>
{`// JavaScript {`// JavaScript
module.exports = createReactIOSNativeComponentClass({ var React = require('react-native');
validAttributes: { myCustomProperty: true }, var { requireNativeComponent } = React;
uiViewClassName: 'MyCustomView',
});`} class MyCustomView extends React.Component {
render() {
return <NativeMyCustomView {...this.props} />;
}
}
MyCustomView.propTypes = {
myCustomProperty: React.PropTypes.oneOf(['a', 'b']),
};
var NativeMyCustomView = requireNativeComponent('MyCustomView', MyCustomView);
module.exports = MyCustomView;`}
</Prism> </Prism>
</div> </div>
<section className="home-bottom-section"> <section className="home-bottom-section">