mithril-query
mithril-query copied to clipboard
Custom style properties prevent MQ from rendering components
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);
``