solid-docs
solid-docs copied to clipboard
classList not working when specified before class
Describe the bug
The order of class and classList props matters.
To Reproduce
Create a component with both class and classList, with classList specified first:
<div classList={...} class="...">...</div>
Observe that classes from classList are ignored (or probably overwritten by class).
Expected behavior
The order of class and classList shouldn't matter, or it should be noted in the docs (e.g. here https://www.solidjs.com/docs/latest/api#classlist) that classList must go after class.
When it's reversed all works fine, both classes from "static" class and "dynamic" classList are used.
Additional context
solid-js 1.1.2
Yeah that's true. I wonder if it is really best to automatically change the order. These do need to run in sequence though. It's much simpler for me to document this for now and consider the implications of re-ordering things later.
Sure, sounds good. It's not a big deal, just a small gotcha, and mentioning this in the docs should be good enough.
Oops closed the wrong issue. In any case, I'm going to send this over to docs.
I am looking into writing an article on how I built my first solid-start app? Maybe instead of writing it as an article I can contribute to docs? Would that be possible?
I am looking into writing an article on how I built my first solid-start app? Maybe instead of writing it as an article I can contribute to docs? Would that be possible?
At the moment we have completely different docs for Solid-Start. But you can contribute to these docs in other ways through sharing your experiences with Solid and sharing anything that you think anyone new to Solid should know