Skip to content

Commit

Permalink
fix: reconcile Fiber props
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyJasonBennett committed Mar 7, 2023
1 parent 074a2c4 commit abb5eb1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ import type { Fiber, HostConfig, Reconciler } from './types'
// Creates an HTMLNode proxy for reconciliation
class PreactFiber extends (HTMLElement as { new (): Fiber['__e'] }) {
setAttribute(name: string, value: any): void {
this.ownerSVGElement ??= null
this[name] = value

const vnode = this.__vnode
if (vnode) {
vnode.props[name] = value
if (vnode.stateNode) _options.diffed?.(vnode)
}
}
appendChild<T extends Node>(node: T): T {
const child = node as unknown as PreactFiber
Expand Down

0 comments on commit abb5eb1

Please sign in to comment.