Skip to content

Commit 3d0b177

Browse files
committed
docs: clarify serializable option wording in README
1 parent f0d3d8b commit 3d0b177

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const Greeting = ({ name = 'World' }) => (
1717
register(Greeting, 'x-greeting', ['name'], { shadow: true, mode: 'open', adoptedStyleSheets: [], serializable: true });
1818
// ^ ^ ^ ^ ^ ^ ^
1919
// | HTML tag name | use shadow-dom | use adoptedStyleSheets |
20-
// Component definition Observed attributes Encapsulation mode for the shadow DOM tree Enable declarative shadow DOM
20+
// Component definition Observed attributes Encapsulation mode for the shadow DOM tree shadow root may be serialized
2121
```
2222

2323
> _**\* Note:** as per the [Custom Elements specification](https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name), the tag name must contain a hyphen._
@@ -81,7 +81,7 @@ register(FullName, 'full-name');
8181

8282
### Passing slots as props
8383

84-
The `register()` function also accepts an optional fourth parameter, an options bag. At present, it allows you to opt-in to using shadow DOM for your custom element by setting the `shadow` property to `true`, and if so, you can also specify the encapsulation mode with `mode`, which can be either `'open'` or `'closed'`. Additionally, you can enable declarative shadow DOM by setting `serializable` to `true`, which is useful for server-side rendering scenarios.
84+
The `register()` function also accepts an optional fourth parameter, an options bag. At present, it allows you to opt-in to using shadow DOM for your custom element by setting the `shadow` property to `true`, and if so, you can also specify the encapsulation mode with `mode`, which can be either `'open'` or `'closed'`. Additionally, the shadow DOM may be serialized by setting `serializable` to `true`, which is useful for server-side rendering scenarios.
8585

8686
When using shadow DOM, you can make use of named `<slot>` elements in your component to forward the custom element's children into specific places in the shadow tree.
8787

@@ -105,9 +105,9 @@ register(TextSelection, 'text-selection', [], { shadow: true });
105105
</text-section>
106106
```
107107

108-
### Declarative Shadow DOM (serializable option)
108+
### `serializable` option
109109

110-
The `serializable` option enables declarative shadow DOM for server-side rendering:
110+
The `serializable` option is set, the shadow root may be serialized.
111111

112112
```js
113113
register(MyComponent, 'my-element', [], {

0 commit comments

Comments
 (0)