Skip to content

No render when combining non-trivial components and having drivers #15

@Elvecent

Description

@Elvecent

Full code here: https://codesandbox.io/s/quirky-butterfly-0pdjd?file=/src/index.ts

function main(sources: any) {
  const counter = Counter(sources, xs.of(2));
  const other = Counter(sources, xs.of(1));
  return {
    react: xs
      .combine(counter.DOM, other.DOM)
      .map((els) => h("div", els))
  };
}

const App = makeComponent(main, {});

render(h(App), document.getElementById("app"));

Given the code above, I get an empty webpage with no components rendered, even though the DOM stream does fire with valid component data.

I can make this work by either removing drivers:

makeComponent(main)

or by replacing my Counter components with something trivial:

.combine(
  xs.of(h("div", "one")),
  xs.of(h("div", "two"))
)

I suspect that there is a bug somewhere in makeComponent code where it branches on non-null drivers argument, but I haven't done any actual investigation.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions