zouhir / preact-habitat

Zero configuration Preact widgets renderer in any host DOM
MIT License
518 stars 43 forks source link

Props removed with clean and inline options set to true #45

Open mattarau opened 5 years ago

mattarau commented 5 years ago

This is almost the same as #16, but in this case it happens when both clean and inline options are set to true.

With this config:

  _habitat.render({
    inline: false,
    clientSpecified: true,
    clean: true
  });

This will work:

  <div class="container">
    <div>LOADING...</div>
    <script type="application/json">
      {
        "token": "kdj4JLH$Kjhdljkio8erO",
      }
    </script>
  </div>

  <script async src="/bundle.js" data-mount-in=".container"></script>

But if you config it like this:

  _habitat.render({
    inline: true,
    clean: true
  });

The following implementation will remove the props.

  <div class="container">
    <div>LOADING...</div>
    <script type="application/json">
      {
        "token": "kdj4JLH$Kjhdljkio8erO",
      }
    </script>
    <script async src="/bundle.js"></script>
  </div>