Skip to content

Bug: WHEN OPEN react developer tools, code will be STOP....this maybe a bug? #20394

Closed
@zhangenming

Description

@zhangenming

React version:

Steps To Reproduce

  1. open react developer tools

Link to code example:

The current behavior

STOP

The expected behavior

no stop

sorry I cant open codesandbox page
this the Minimum recurrence code

export default function App() {
  const [count, set_count] = useState(0)
  const ref_count = useRef()

  ref_count.current = () => set_count(count + 1)
  

  useEffect(() => {
    var id = setInterval(() => {
      ref_count.current()
    }, 100)
    return () => clearInterval(id)
  }, [])

  return count
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: UnconfirmedA potential issue that we haven't yet confirmed as a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions