I'm making a simple library which turns JS objects into JS class componeents to register and use in HTML. I'm testing it with a simple object:
const myEle = {
state: {
message: `Hello World`
},
template: `<p> ${this.state.message} </p>`,
style: {
color: "red"
},
hooks: {
onClick: () => alert("Hi!")
},
attrs: {},
element: toComp(this.template, this.style, this.state, this.hooks, this.attrs)
}
Specifically, the error is with template
. which gives me the error mentioned in the title, despite this.state.message
making snese ti ne. Why is that happening?