MVCoconut / coconut.vdom

Coconut rendering through virtual-dom.
The Unlicense
19 stars 8 forks source link

[gen4] key not working #15

Closed kevinresol closed 5 years ago

kevinresol commented 5 years ago
class Main extends coconut.ui.View {
  static function main() {
    coconut.Ui.hxx('<Main/>').renderInto(js.Browser.document.body);
  }
  function render() '<div><Foo/></div>';
}

class Foo extends coconut.ui.View {
    @:state var key:String = '1';
    function render() '<div key=${key}/>';
    override function viewDidMount() key = '2';
}

See error in console:

 TypeError: Cannot read property 'insertBefore' of null
back2dos commented 5 years ago

Fixed.