OpenC3/cosmos

View on GitHub
openc3/templates/tool_react/src/openc3-tool_name.js

Summary

Maintainability
A
30 mins
Test Coverage
import React from "react";
import ReactDOM from "react-dom";
import singleSpaReact from "single-spa-react";
import Root from "./root.component";

const lifecycles = singleSpaReact({
  React,
  ReactDOM,
  rootComponent: Root,
  errorBoundary(err, info, props) {
    // Customize the root error boundary for your microfrontend here.
    return null;
  },
  domElementGetter: function () {
    let elem = document.getElementById("openc3-tool");
    if (elem) {
      return elem;
    } else {
      return new HTMLElement();
    }
  },
});

export const { bootstrap, mount, unmount } = lifecycles;