developit / developit/preact-shadow-root

Support Preact X

Open
#6 2 comments 4 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
73
Forks
6
PR merge metrics
No merged PRs in 30d

Description

- `this.base` is `undefined` at `componentDidMount`, so `this.shadow` never gets initialized.
- `props.children[0]` is `undefined`, since `children` isn’t always an array anymore.
- The third argument to `render()` should be removed, as per the Preact X upgrade docs.

I run the following replacements on my bundle as a workaround:

```js
// Hacks to make `preact-shadow-root` work with Preact 10.
"this.base&&this.base.parentNode": "this.__P",
"o.children[0],": "o.children,",
"this.shadow.firstChild": "undefined",
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.