Repository navigation
v5.8.6 - Patch Update
Change Log
Consistency, Extensability
-
Bug fix: There are some very edge cases cenarios where updating state from parent by emiting event from child onmount was rendering unexpected html output results. Adding a quick fix for those cases.
-
Template "children" support.
For cases where user wants to chare a web component using jails, There wasn't a easy way to wrap children with html code just like React and other frameworks does withchildrenorslotfeatures.
So it was added on this version, achildrenprop forexport const template()function in order to access children data from server rendered html.
Example
Consider a web component that have to wrap the default html children.
import { html } from 'jails-js/html'
export default function appTitle({ main }) {
//
main(() => {
})
}
export const template = ({ children }) => {
return html`
<section>
<h1>${children}</h1>
</section>
`
} import jails from 'jails-js'
import * as appTitle from 'components/app-title'
jails.register('app-title', appTitle)
jails.start()<app-title>My Title</app-title>Output
<section>
<h1>My Title</h1>
</section>