Skip to content

编译类型无法抛出错误 #349

Open
@maoxiaoke

Description

@maoxiaoke

以下面代码为例:

import { useState } from 'react';

const App = () => {
  const [count, setCount] = useState(0);

  const addCount = () => {
    setCount((c: number) => c + '1');
  };

  return (
    <div>
      <button onClick={addCount}>Add Count</button>
      <p>{count}</p>
    </div>
  );
};

export default App;

类型编译成功,没有抛出错误

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpkgv2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions