Skip to content

What am I doing wrong? #385

@AmandaOliver

Description

@AmandaOliver

Hello!,
I'm quite new with hyperHTML, and I cannot wrap my head around conditional rendering of wires just yet.
I have some cases when depending on some application state I do not want to render a specific wire at all, in those cases I'm using a structure like this:
const nestedWire = this.state.showNested ? this.renderNestedWire() : '';
which is giving me headaches when having several nested wires, as sometimes the parent doesn't detect changes.

While trying to recreate the issue i'm having with nested wires I've put up a code example that isn't re-rendering when the reference object is updated, I've followed the debugger and hyperHTML IS detecting changes and returning the correct wired content in the render function. But the bind "isn't picking it up" so the content is not being updated.
To test it just execute showNestedToggle(false) from the console.

So my questions would be:

  1. how to handle conditional rendering of wires properly
  2. what is wrong in this code?

I am afraid I am doing something terribly wrong, I just cannot understand what.

Edit optimistic-greider-p96bb

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