How to use rax-pwa - 2 common examples

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 4 years ago

Package Health Score

57 / 100
Full package analysis

Similar packages