Package Exports
- preactement
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (preactement) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
preactement
Sometimes, it's useful to let the DOM render our components when needed. Custom Elements are great at this. They provide various methods that can inform you when an element is "connected" or "disconnected" from the DOM.
This package provides the ability to use an HTML custom element as the root for your components. It's intended to provide an easy way for you to integrate Preact into other server side frameworks that might render your HTML. The exported function can also be used for hydration from SSR in Node.
Getting Started
Install with Yarn:
$ yarn add preactementInstall with NPM:
$ npm i preactementUse Cases
The following are a few situations where preactement might come in handy. I'm sure there are others, but these were useful to me.
TBD
Acknowledgement
This function takes heavy inspiration from the excellent preact-custom-element. That library served as a starting point for this package, and all of the Preact guys deserve a massive dose of gratitude. I had slightly different needs, so decided to build this as part solution, part learning excersize.