preact-habitat icon indicating copy to clipboard operation
preact-habitat copied to clipboard

Ability to replace the container rather than mount inside

Open sampotts opened this issue 7 years ago • 1 comments

Is it possible to replace the container you specify rather than mounting inside? I'm just trying to reduce DOM elements. I understand it may be a limitation of Preact/React - sorry, I'm old skool and still getting up to speed. If so, feel free to close this.

For example:

<div class="some-class">
  <script type="text/props">
    {
      "title": "Widget Title passed as prop",
      "theme": "red",
      "anotherProp": "Thanks for trying this widget out!"
    }
  </script>
</div>

... would render ...

<div class="my-widget">
  ...
</div>

... rather than ...

<div class="some-class">
  <div class="my-widget">
    ...
  </div>
</div>

sampotts avatar May 10 '18 05:05 sampotts

I think this is a legit use case, I will implement that.

zouhir avatar Oct 24 '21 02:10 zouhir