mirror of https://github.com/sveltejs/svelte
fix(perf): use classList.toggle instead of add/remove (#8629)
`classList.toggle(..., flag)` has been a part of the DOM standard forever, so better use it instead of possibly causing browser deopts by using dynamic attribute access. The `!!` is required because an `undefined` flag means flipping the current state. --------- Co-authored-by: Dominik G <dominik.goepel@gmx.de> Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com> Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com> Co-authored-by: Rich Harris <hello@rich-harris.dev>pull/8654/head
parent
734cc19846
commit
a52106405d
Loading…
Reference in new issue