I updated some npm packages in my Gatsby project and now I\'m seeing this warning in console:
React-hot-loader: react-
As of summer 2020, this is the current solution recommended on Gatsby's GitHub repository:
Run this command - But running this alone won't fix the issue:
npm install -D @hot-loader/react-dom
// or
yarn add -D @hot-loader/react-dom
Modify gatsby-node.js
to add the following:
exports.onCreateWebpackConfig = ({ stage, actions }) => {
if (stage.startsWith("develop")) {
actions.setWebpackConfig({
resolve: {
alias: {
"react-dom": "@hot-loader/react-dom",
},
},
})
}
}
Restart gatsby develop
. The warning is gone.