Skip to content

Commit

Permalink
fix: get React Hooks working!
Browse files Browse the repository at this point in the history
Add the `setConfig` fix from gatsbyjs/gatsby#9489 (comment) to get Hooks working in develop mode using hot module reloading. This may cause issues where the data gets out of sync, but it’s the best we can hope for right now.
  • Loading branch information
jlengstorf committed Nov 2, 2018
1 parent 7c368ac commit 2ff9ed8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import React, { useState } from 'react';
import { setConfig } from 'react-hot-loader';

setConfig({ pureSFC: true });

export default () => {
const [count, setCount] = useState(0);
Expand Down

0 comments on commit 2ff9ed8

Please sign in to comment.