Skip to content

a single-spa plugin for solid-js applications

License

Notifications You must be signed in to change notification settings

nduartech/single-spa-solid

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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;

About

a single-spa plugin for solid-js applications

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%