Skip to content

Commit 167e339

Browse files
committed
Merge branch 'serializable' of github.com:fusionstrings/preact-custom-element into serializable
2 parents 3d0b177 + 3f083ad commit 167e339

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/index.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@ export default function register(Component, tagName, propNames, options) {
1515
inst._vdomComponent = Component;
1616

1717
if (options && options.shadow) {
18-
const shadowOptions = { mode: options.mode || 'open' };
19-
if (options.serializable !== undefined) {
20-
shadowOptions.serializable = !!options.serializable;
21-
}
22-
inst._root = inst.attachShadow(shadowOptions);
18+
inst._root = inst.attachShadow({
19+
mode: options.mode || 'open',
20+
serializable: options.serializable ?? false,
21+
});
2322

2423
if (options.adoptedStyleSheets) {
2524
inst._root.adoptedStyleSheets = options.adoptedStyleSheets;

0 commit comments

Comments
 (0)