Skip to content

react-scripts 4.0.1 hot reload bug ( but 3.4.3 works ) #10287

Description

@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;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions