How to use the single-spa-react.defaultReactApp function in single-spa-react

To help you get started, we’ve selected a few single-spa-react 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 CanopyTax / single-spa-examples / apps / todomvc-react-0.13.3 / single-spa.config.js View on Github external
import menu from "single-spa-examples-menu";
import { appWithGlobals } from "single-spa-globals";
import { defaultReactApp } from "single-spa-react";

export const publicRoot = '/apps/todomvc-react-0.13.3';
export const pathToIndex = 'index.html';

const reactApp = defaultReactApp({
    rootElementGetter: function() {
        return document.querySelector('.todoapp');
    },
    mountApp: function() {
        if (window.render) {
            window.render();
        }
    }
});
export const lifecycles = [menu(), appWithGlobals(['Router', 'app', 'render']), reactApp];

single-spa-react

Single-spa lifecycles helper for React apps

MIT
Latest version published 4 months ago

Package Health Score

81 / 100
Full package analysis

Popular single-spa-react functions