Closed reznord closed 1 year ago
I like that this makes the widget accessible to programatically control it.
would it be possible to somehow return the object by the .render
function? This would allow to have multiple widgets on the same page and make all of those accessible.
let myWidget = _habitat.render({...});
do you think this can make it in master? would be super helpful. //cc @zouhir
@zouhir friendly ping. do you think this could make it in a release?
hey @zouhir that's nice. Though I think I am not a very good maintainer for the library as I know too little about preact and the details of this library. I think @reznord is the right person to support!! <3
Right now there is no way to access the widget from the global scope. For eg: if I want to access the widget on a global scope (
window.widget.foo()
) it is not possible till now because it wasn't possible to add a reference on the widget level.This PR adds support for adding ref to the component itself.