Skip to content

Commit

Permalink
use for..of over forEach for browser compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinjude committed Aug 8, 2022
1 parent db2e64e commit 76b2302
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ const hiddenRoot = document.createElement(`div`)

const removePrevHeadElements = () => {
const prevHeadNodes = document.querySelectorAll(`[data-gatsby-head]`)
prevHeadNodes.forEach(e => e.remove())

for (const node of prevHeadNodes) {
node.remove()
}
}

const onHeadRendered = () => {
Expand Down

0 comments on commit 76b2302

Please sign in to comment.