react-native-navigation的迁移库

ContainerRegistry.js 534B

1234567891011121314151617181920212223
  1. import React from 'react';
  2. import {AppRegistry, Component} from 'react-native';
  3. export function registerContainer(containerKey, getContainerFunc) {
  4. const OrigContainer = getContainerFunc();
  5. const WrappedContainer = wrapContainer(OrigContainer);
  6. AppRegistry.registerComponent(containerKey, () => WrappedContainer);
  7. }
  8. function wrapContainer(OrigComponent) {
  9. return class extends Component {
  10. //constructor(props) {
  11. // super(props);
  12. //}
  13. render() {
  14. return (
  15. <OrigComponent/>
  16. );
  17. }
  18. };
  19. }