opencomponents / oc-client-browser

The OpenComponents Browser client
MIT License
6 stars 8 forks source link

allow passing id #114

Closed ricardo-devis-agullo closed 1 month ago

ricardo-devis-agullo commented 1 month ago

This allows passing an id to the component like

<oc-component href="..." id="myuniqueid" />

and this will be respected by the component. This is useful to control from the outside the component being rendered when using something like React, where then you can send specific events for unmounting like

React.useEffect(() => {
  return () => {
    window.oc.events.fire('oc:unmount', { id: 'myuniqueid' });
  };
}, []);