react-native-navigation的迁移库

Element.tsx 617B

123456789101112131415161718192021222324252627282930313233
  1. import * as React from 'react';
  2. import * as PropTypes from 'prop-types';
  3. import { requireNativeComponent } from 'react-native';
  4. let RNNElement: React.ComponentType<any>;
  5. export class Element extends React.Component<{ elementId: any; resizeMode?: any; }, any> {
  6. static propTypes = {
  7. elementId: PropTypes.string.isRequired,
  8. resizeMode: PropTypes.string
  9. };
  10. static defaultProps = {
  11. resizeMode: ''
  12. };
  13. render() {
  14. return (
  15. <RNNElement {...this.props} />
  16. );
  17. }
  18. }
  19. RNNElement = requireNativeComponent(
  20. 'RNNElement',
  21. Element,
  22. {
  23. nativeOnly: {
  24. nativeID: true
  25. }
  26. }
  27. );