Closed nousacademy closed 6 years ago
/** @jsx etch.dom */ const etch = require('etch') class MyComponent { constructor (properties) { this.properties = properties etch.initialize(this) } render () { return <div>{this.properties.greeting} World!</div> } update (newProperties) { if (this.properties.greeting !== newProperties.greeting) { this.properties.greeting = newProperties.greeting return etch.update(this) } else { return Promise.resolve() } } } // in an async function... let component = new MyComponent({greeting: 'Hello'}) console.log(component.element.outerHTML) // ==> <div>Hello World!</div> await component.update({greeting: 'Salutations'}) console.log(component.element.outerHTML)
Im using this exact same sample and its not working, the virtualNode object gets update, but the actual text of the element isnt!
I'm puzzled
figured it out nvm
Im using this exact same sample and its not working, the virtualNode object gets update, but the actual text of the element isnt!