Skip to content

Commit

Permalink
feat(rdom): add null check for $remove()
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Mar 30, 2023
1 parent 81abf60 commit db9d2a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/rdom/src/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export const $addChild = (
*
* @param el
*/
export const $remove = (el: Element | Comment) => el.remove();
export const $remove = (el: Element | Comment) => el && el.remove();

/**
* Migrates given element to `newParent`, following the same append or insertion
Expand Down

0 comments on commit db9d2a1

Please sign in to comment.