Skip to content

当前的usePrevious实现违反了useRef的使用准则的。 #780

Closed
@heroboy

Description

@heroboy

在render中不能读写current。除了,这种模式:

if (!ref.current)
{
    ref.current = 123;
}

facebook/react#18545

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions