react fast refresh support

react fast refresh support

With #Nextjs 9.4 React Fast Refresh is introduced. Fast Refresh is a new hot reloading experience that gives you instantaneous feedback on edits made to your React components. Make sure you have no class components or unnamed default exports. #javascript #programming #reactjs

Copy Snippet
/*
* Fast Refresh is a new hot reloading experience that gives you instantaneous feedback on edits made to * your React components.
*/

// This will not get optimal results.
// pages/index.js
export default (props) => {
	return <MyComponent />
}

// This will give better results.
const Home = (props) => {
  return <MyComponent />
}
  
export default Home