Skip to content

Docs: Homepage example of components is different from Components section, broken #678

Description

@Iremlap

On the Homepage for Hyperscript, there is an example of using a component structured as:

<template component="click-counter"
          _="init set ^count to 0">
  <button _="on click increment ^count">+</button>
  <span>Clicks: ${^count}</span>
</template>

<click-counter></click-counter>
<click-counter></click-counter>

which doesn't seem to work when I try it in the playground or my own file locally. It also differs from the examples within the Components section:

<script type="text/hyperscript-template" component="click-counter" _="set ^count to 0">
  
  <button _="on click increment ^count">+</button>
  <span class="label">Clicks: ${^count}</span>
</script>

<click-counter></click-counter>
<br>
<click-counter></click-counter>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions