Skip to content

Define props on script tag for "inline" render? #46

@niccross

Description

@niccross

Hey! Love this project in a major way! While tinkering around I noticed that the data-prop-propname attributes are ignored on the script tag. Can this be allowed?

<script async src="/bundle.js" data-prop-my-prop="yes please"></script>

Also, by accident I noticed that habitat will pull in ALL props defined in a script tag document-wide. Is this by design? Maybe we could pass a selector for the props instead of assuming all JSON in script tags belong to habitat?

... Now I have to say "All your JSONs are belong to us!" ... sorry if you don't get the reference. 😜

<script class="this-belongs-to-my-habitat" type="application/json">
{
  "forMyHabitat": true
}
</script>
<script type="application/json">
{
  "forMyHabitat": false
}
</script>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions