MVCoconut / coconut.ui

Wow, such reactive view! Much awesome!
The Unlicense
89 stars 9 forks source link

getDerivedStateFromAttributes doesn't work when there is a func attr #47

Closed kevinresol closed 4 years ago

kevinresol commented 4 years ago
class Main extends coconut.ui.View {
  @:attr var foo:String->Void;
  static function main() {}
  function render() '<div/>';
  static function getDerivedStateFromAttributes(attrs) return {}
}

gives: Explicit type required for field foo

kevinresol commented 4 years ago

this works:

@:attr function foo(s:String):Void;

Somehow the function argument type (String) is lost when specified by the var syntax. args: [{name: a0, opt: false, type: null}]