Bug: <div class:foo={undefined}/> seems to compile to _el$2.classList.toggle("foo", undefined);, which is the opposite of what we want (it turns the class on). Similarly <div class:foo={foo}/> where foo is a local variable. So I guess the literals not matching the if need to be !!d at compile time.
By contrast, <div class:foo={foo()}/> compiles correctly to
I was reviewing https://github.com/solidjs/solid-docs/commit/4850acf52752db5ebe28e05f593567339d0b0c83 but don't understand the code well enough to read it, so I just tested it.
Bug:
<div class:foo={undefined}/>
seems to compile to_el$2.classList.toggle("foo", undefined);
, which is the opposite of what we want (it turns the class on). Similarly<div class:foo={foo}/>
wherefoo
is a local variable. So I guess the literals not matching theif
need to be!!
d at compile time.By contrast,
<div class:foo={foo()}/>
compiles correctly toAlso
classList
works great.