Skip to content

Bug: useMemo exec twice in StrictMode,But console.log only exec once,console.debug exec twice #20982

Closed
@cqh963852

Description

@cqh963852

React version:17.0.1

Steps To Reproduce

  1. Wrap app in StrictMode
  2. Do a function in useMemo

Link to code example:

https://codesandbox.io/s/vigilant-tree-igscd

The current behavior

The console.log in setSlot only exec once.
image

The expected behavior

Exec the console.log twice in setSlot funciton.

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