|
|
|
@ -904,7 +904,7 @@ The following initialisation options can be provided:
|
|
|
|
| `target` | **none** | An `HTMLElement` to render to. This option is required
|
|
|
|
| `target` | **none** | An `HTMLElement` to render to. This option is required
|
|
|
|
| `anchor` | `null` | A child of `target` to render the component immediately before
|
|
|
|
| `anchor` | `null` | A child of `target` to render the component immediately before
|
|
|
|
| `props` | `{}` | An object of properties to supply to the component
|
|
|
|
| `props` | `{}` | An object of properties to supply to the component
|
|
|
|
| `context` | `new Map()` | A `Map` of context key-value pairs to supply to the component
|
|
|
|
| `context` | `new Map()` | A `Map` of root-level context key-value pairs to supply to the component
|
|
|
|
| `hydrate` | `false` | See below
|
|
|
|
| `hydrate` | `false` | See below
|
|
|
|
| `intro` | `false` | If `true`, will play transitions on initial render, rather than waiting for subsequent state changes
|
|
|
|
| `intro` | `false` | If `true`, will play transitions on initial render, rather than waiting for subsequent state changes
|
|
|
|
|
|
|
|
|
|
|
|
@ -1083,17 +1083,20 @@ const { head, html, css } = App.render({
|
|
|
|
});
|
|
|
|
});
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
You can call the `.render()` with the following parameters:
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
| option | default | description |
|
|
|
|
The `.render()` method accepts the following parameters:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| parameter | default | description |
|
|
|
|
| --- | --- | --- |
|
|
|
|
| --- | --- | --- |
|
|
|
|
| `props` | `{}` | An object of properties to supply to the component
|
|
|
|
| `props` | `{}` | An object of properties to supply to the component
|
|
|
|
| `options` | `{}` | An object of options
|
|
|
|
| `options` | `{}` | An object of options
|
|
|
|
|
|
|
|
|
|
|
|
The `options` object takes in the following properties:
|
|
|
|
The `options` object takes in the following options:
|
|
|
|
| key | default | description |
|
|
|
|
|
|
|
|
|
|
|
|
| option | default | description |
|
|
|
|
| --- | --- | --- |
|
|
|
|
| --- | --- | --- |
|
|
|
|
| `context` | `new Map()` | A `Map` of context key-value pairs to supply to the component
|
|
|
|
| `context` | `new Map()` | A `Map` of root-level context key-value pairs to supply to the component
|
|
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
```js
|
|
|
|
const { head, html, css } = App.render(
|
|
|
|
const { head, html, css } = App.render(
|
|
|
|
@ -1101,7 +1104,7 @@ const { head, html, css } = App.render(
|
|
|
|
{ answer: 42 },
|
|
|
|
{ answer: 42 },
|
|
|
|
// options
|
|
|
|
// options
|
|
|
|
{
|
|
|
|
{
|
|
|
|
context: new Map([['context-key', 'context-value']]),
|
|
|
|
context: new Map([['context-key', 'context-value']])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
);
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|