Skip to content

Cannot update dom when initial state is undefined or null #471

@cubxx

Description

@cubxx
const s = van.state();
van.add(document.body, van.tags.div(() => s.val));
s.val = 'new';

The initial s.val is undefined, so vanjs won't create a DOM to bind with the state.
Maybe creating an empty TextNode is a solution.

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