Closed daiict218 closed 7 years ago
You have to add /** @jsx etch.dom */
after "use babel"
in your "view" file.
This tells babel how to "translate" the <div></div>
.
By default babel translate it into React.createElement('div')
but with the above comment it uses etch.dom('div')
instead.
You can also use plain JS by calling helper methods defined on etch.dom
, as follows:
const etch = require('etch')
const $ = etch.dom
$.div(null, $.span(null, 'hello'), $.span({style: {fontWeight: 'bold'}}, 'world'))
Not as pretty but simpler in a lot of ways.
Anyway, closing this out. Thanks @lloiser for answering this.
Although React is not a dependency of
etch
, it says "React is not defined".my plugin code is as follows :
and My view code is as follows :
Can someone help me?