WebReflection / neverland

React like Hooks for lighterhtml
https://medium.com/@WebReflection/neverland-the-hyperhtmls-hook-a0c3e11324bb
ISC License
244 stars 7 forks source link

Don't `Template` holes that wouldn't return instances of `Hole` #45

Closed WebReflection closed 4 years ago

WebReflection commented 4 years ago

This is an interesting test case that both validated neverland works pretty much exactly as React, but it also shows an easy to get into issue, when hooks are used within a callback that wouldn't return a lighterhtml Hole instance.

There are two possibilities I see here:

  1. emphases on the fact neverland wrapper should be used only for callbacks that return HTML/SVG elements
  2. avoid wrapping into "holes" things that are not supposed to land on the dom, and yet use hooks

This is neither blocking nor likely easy to solve, hence I'd like to park it in here until the day I figure out if option 2, fallback-ing to 1, would be possible.

WebReflection commented 4 years ago

As I've went for the first point in the README, this can be closed.