Type 'void' is not assignable to type '((event: MouseEvent) => void) | undefined'

后端 未结 5 1740
花落未央
花落未央 2020-12-24 11:06
   import * as React from \"react\";
   import \"./App.css\";
   import PageTwo from \"./components/PageTwo\";

    export interface IPropsk {
        data?: Array&l         


        
5条回答
  •  没有蜡笔的小新
    2020-12-24 11:27

    As @basarat said above, when you have something like button.onclick = thisFunction(); you are already calling that function. You may want to just assign that function but not to call it,

    so you would write like this button.onclick = thisFunction;.

提交回复
热议问题