Skip to content

Custom style properties prevent MQ from rendering components #113

@JordanMcInnisGithub

Description

@JordanMcInnisGithub

As per title, mithril query fails to render components that are passed custom style properties via mithril js syntax. For instance, declaring a component with mq such as:

const someComp = mq(someComp, { attr1: true, attr2: false, style: {"--testVar": 12}});

or within the component view such as:

return m("some-name", { style: { "--testVar": 12}}, [childrenHere...]);

...will cause the following error when running tests

TypeError: Cannot read properties of undefined (reading 'type')

However, setting up the same functionality in the same way, but adding the properties via js inside the component view()/oncreate() causes no issues.

document.querySelector(".someComp").style.setProperty("--testVar", 12);

``

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