react-native-navigation的迁移库

ContainerRegistry.js 546B

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