Skip to content

Commit

Permalink
fix: splice null child (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyJasonBennett authored Jul 19, 2023
1 parent 9e139ed commit e56bb40
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ class FiberNode extends HTMLElement {
return super.appendChild(node)
}
insertBefore<T extends Node>(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) {
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit e56bb40

Please sign in to comment.