Skip to content

Commit

Permalink
Attempt to add the IntersectionObserver polyfill
Browse files Browse the repository at this point in the history
Why:

* The site is not working in Safari, missing the IntersectionObserver
  polyfill, which we are apparently not importing correctly.

This change addresses the issue by:

* Implementing the configuration suggested in
  gatsbyjs/gatsby#10435 (comment)
  • Loading branch information
pfac committed Apr 4, 2019
1 parent 21a59cb commit 8f8b26d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gatsby-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* See: https://www.gatsbyjs.org/docs/browser-apis/
*/

exports.onInitialClientRender = () => {
require("intersection-observer")
export const onClientEntry = async () => {
if (typeof IntersectionObserver === "undefined") {
await import("intersection-observer")
}
}

0 comments on commit 8f8b26d

Please sign in to comment.