Skip to content

[Bug] 三元判断下,嵌套了箭头函数后报错error: Expected '=>', got ':' #13196

@uuRRx0

Description

@uuRRx0

What happens?

某些情况下,max setup 报错 error: Expected '=>', got ':'

Mini Showcase Repository(REQUIRED)

最小重现

How To Reproduce

Steps to reproduce the behavior: 1. 2.

Expected behavior 1. 2.

直接初始化max项目后,添加以下代码到某个组件,然后运行 max setup

  const a = useMemo(
    () =>
      Math.random() > 0.1
        ? (item: any) => {
            const getLeafType = (ele?: any): any => {
              return [false];
            };

          }
        : () => false,
    [],
  );

Context

  • Umi Version: 4.6.0
  • Node Version: v22
  • Platform: win11

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