diff --git a/package.json b/package.json index ac49526..0286e0d 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "@types/react": "^18.0.28", "@types/react-dom": "^18.0.11", "jsdom": "^21.1.0", - "preact": "^10.13.0", + "preact": "^10.16.0", "react": "^18.2.0", "react-dom": "^18.2.0", "three": "^0.150.1", diff --git a/src/index.ts b/src/index.ts index 8023fd0..a1857ca 100644 --- a/src/index.ts +++ b/src/index.ts @@ -178,6 +178,8 @@ class FiberNode extends HTMLElement { return super.appendChild(node) } insertBefore(node: T, beforeNode: Node | null): T { + if (beforeNode === null) return this.appendChild(node) + const child = node as unknown as FiberNode const beforeChild = beforeNode as unknown as FiberNode if (this.fiber) { diff --git a/yarn.lock b/yarn.lock index 9d129bd..6af83fd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1420,10 +1420,10 @@ potpack@^1.0.1: resolved "https://registry.yarnpkg.com/potpack/-/potpack-1.0.2.tgz#23b99e64eb74f5741ffe7656b5b5c4ddce8dfc14" integrity sha512-choctRBIV9EMT9WGAZHn3V7t0Z2pMQyl0EZE6pFc/6ml3ssw7Dlf/oAOvFwjm1HVsqfQN8GfeFyJ+d8tRzqueQ== -preact@^10.13.0: - version "10.13.0" - resolved "https://registry.yarnpkg.com/preact/-/preact-10.13.0.tgz#f8bd3cf257a4dbe41da71a52131b79916d4ca89d" - integrity sha512-ERdIdUpR6doqdaSIh80hvzebHB7O6JxycOhyzAeLEchqOq/4yueslQbfnPwXaNhAYacFTyCclhwkEbOumT0tHw== +preact@^10.16.0: + version "10.16.0" + resolved "https://registry.yarnpkg.com/preact/-/preact-10.16.0.tgz#68a06d70b191b8a313ea722d61e09c6b2a79a37e" + integrity sha512-XTSj3dJ4roKIC93pald6rWuB2qQJO9gO2iLLyTe87MrjQN+HklueLsmskbywEWqCHlclgz3/M4YLL2iBr9UmMA== prelude-ls@~1.1.2: version "1.1.2"