How to use the rax-pwa.getCurrentComponent function in rax-pwa

To help you get started, we’ve selected a few rax-pwa examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alibaba / rax / packages / universal-app-runtime / src / renderApp.js View on Github external
// process Shell.getInitialProps
    // use global props appProps as shell default props
    const shellProps = { ...appProps };
    if (withSSR && AppShell !== null && window.__INITIAL_DATA__.shellData !== null) {
      Object.assign(shellProps, window.__INITIAL_DATA__.shellData);
    }

    // process App.getInitialProps
    if (withSSR && window.__INITIAL_DATA__.appData !== null) {
      Object.assign(appProps, window.__INITIAL_DATA__.appData);
    }

    // Render
    if (hydrate) {
      // Avoid router empty initialComponent
      getCurrentComponent(appProps.routerConfig.routes, withSSR)().then(function(InitialComponent) {
        if (InitialComponent !== null) {
          appProps.routerConfig.InitialComponent = InitialComponent;
        }
        processRenderWebApp(shellProps);
      });
    } else {
      processRenderWebApp(shellProps);
    }
  }
};

rax-pwa

Rax pwa templates

BSD-3-Clause
Latest version published 5 years ago

Package Health Score

57 / 100
Full package analysis