Skip to content

Commit

Permalink
Replace hydrate function with render to avoid css dropping bug in gas…
Browse files Browse the repository at this point in the history
…tby/react (#10)
  • Loading branch information
duckbyte authored Apr 13, 2020
1 parent fa66657 commit 0c5393f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions gatsby-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,12 @@
import "typeface-source-sans-pro"

import "prismjs/themes/prism.css"

// replace hydrate function with straight render to fix https://github.com/gatsbyjs/gatsby/issues/8560. Does affect performance
const ReactDOM = require("react-dom")

export function replaceHydrateFunction() {
return (element, container, callback) => {
ReactDOM.render(element, container, callback)
}
}

0 comments on commit 0c5393f

Please sign in to comment.