-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
Description
I have been trying to follow the instructions. Currently I have something like this
export default function SimpleComp(props) {
let name = props.name;
const onButtonClick = props.onButtonClick;
return (
<div>
hello all, the name is {name}
<button onClick={onButtonClick}>Click this</button>
</div>
);
}
register(SimpleComp, 'simple-component', [
'name'
],
{
onButtonClick: e => {
console.log(e)
e.stopPropagation();
return new Event('clickbutton', { bubbles: true })
}
}
)
Now in my app.js I use it like this
<simple-component name='webcomponent' onButtonClick="console.log('attribute callback 'onclickbutton' triggered', this)"> </simple-component>
The component shows up fine but when trying to emit an event the eventemitter on the register function works but the function on the parent does not run.
Reactions are currently unavailable