UnimplementedView.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /**
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. *
  7. * @flow strict-local
  8. * @format
  9. */
  10. 'use strict';
  11. const React = require('react');
  12. const StyleSheet = require('../../StyleSheet/StyleSheet');
  13. /**
  14. * Common implementation for a simple stubbed view. Simply applies the view's styles to the inner
  15. * View component and renders its children.
  16. */
  17. class UnimplementedView extends React.Component<$FlowFixMeProps> {
  18. render(): React.Node {
  19. // Workaround require cycle from requireNativeComponent
  20. const View = require('../View/View');
  21. return (
  22. <View style={[styles.unimplementedView, this.props.style]}>
  23. {this.props.children}
  24. </View>
  25. );
  26. }
  27. }
  28. const styles = StyleSheet.create({
  29. unimplementedView: __DEV__
  30. ? {
  31. alignSelf: 'flex-start',
  32. borderColor: 'red',
  33. borderWidth: 1,
  34. }
  35. : {},
  36. });
  37. module.exports = UnimplementedView;