-
Notifications
You must be signed in to change notification settings - Fork 53
Open
Labels
Description
Hi, great library. I have a question on how to expose properties of a component to the DOM. It looks like you are iterating through the attributes to expose as the CustomElement prototype:
https://github.com/bspaulding/preact-custom-element/blob/master/src/index.js#L6
but am a little confused on what these would actually be. I mistakenly assumed I'd be able to define properties on the Preact component and automatically export them:
class Example extends Component {
report() {
console.log('SOUND OFF!')
}
render() {
...
}
However this does not work:
var example = $('x-example')[0];
example.report();
What would be the best way to do this?