react-scripts 4.0.1 hot reload bug ( but 3.4.3 works )
Created by: wendux
Describe the bug
import React, {useState} from 'react';
function Example(props) {
return <div>{props.title}</div>
}
const ExampleNew = React.memo(Example, (prevProps, nextProps) => {
// update here ,hot reload doesn't work unless refreshing the page in browser
// console.log("2")
console.log("1")
return false
})
function App() {
const [count, setCount] = useState(0);
return (
<div>
<ExampleNew title={count}/>
<button onClick={() => setCount(count + 1)}>
Click me
</button>
</div>
);
}
export default App;