@nathanld/single-spa-solid
TypeScript icon, indicating that this package has built-in type declarations

0.1.10 • Public • Published

single-spa-solid (inspired by single-spa-preact)

https://www.npmjs.com/package/@nathanld/single-spa-solid

Generic lifecycle hooks for Solid applications that are registered as applications of single-spa.

Full documentation for Preact

Instead of:

import preact from "preact";
import rootComponent from "./path-to-root-component.js";
import singleSpaPreact from "single-spa-preact";

const preactLifecycles = singleSpaPreact({
preact,
rootComponent,
domElementGetter: () => document.getElementById("main-content"),
});

export const bootstrap = preactLifecycles.bootstrap;
export const mount = preactLifecycles.mount;
export const unmount = preactLifecycles.unmount;

do something like:

import App from "./App";
import { render } from 'solid-js/web';
import singleSpaSolid from '@nathanld/single-spa-solid';

const solidLifecycles = singleSpaSolid({
    solid: {render: render},
    rootComponent: App,
    domElementGetter: () => document.getElementById('root')
});


export const bootstrap = solidLifecycles.bootstrap;
export const mount = solidLifecycles.mount;
export const unmount = solidLifecycles.unmount;

Disclaimer: This may or may not have been generated by a GPT... Use it at your own peril.

Package Sidebar

Install

npm i @nathanld/single-spa-solid

Weekly Downloads

11

Version

0.1.10

License

MIT

Unpacked Size

6.66 kB

Total Files

6

Last publish

Collaborators

  • nathanld