Skip to content

0:0 error Parsing error: Cannot read property 'map' of undefined #3

@doerme

Description

@doerme

报错源码

function useSyncRefState<T>(initialValue: T | (() => T)): [T, React.Dispatch<T>, React.RefObject<T>] {
//function body
}

issue_01

其中一个文件需要改为以下代码才能移除报错

function useSyncRefState<T>(
  initialValue: T | (() => T),
): {
  [0]: T
  [1]: React.Dispatch<T>
  [2]: React.RefObject<T>
} {
// funnction body
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions