developit / developit/preact-shadow-root

Support Preact X

Aperta
#6 2 commenti 4 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
73
Fork
6
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

- `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",
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.