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

Open Beginner friendly
#678 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Quiet
Tech stack
javascript
Domain
documentation

Research direction

The issue points to the Hyperscript homepage and Components section; compare their component examples and reproduce the homepage snippet in the playground. Update the homepage example to match the documented component usage, then verify that it works in the playground and locally.

Written by the indexing model from the issue text.

Description

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>
Dominant language
JavaScript
Stars
3.8k
Forks
171
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bigskysoftware/_hyperscript

All issues in bigskysoftware/_hyperscript

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.