Allow activeClass to receive multiple classes
franciscohanna92 opened this issue · comments
Francisco Hanna commented
As of today, when passing multiple classes to the prop activeClass
(i.e. activeClass="font-bold text-blue-500"
) an exception is thrown:
Uncaught DOMException: Failed to execute 'add' on 'DOMTokenList': The token provided ('font-bold text-blue-500') contains HTML space characters, which are not valid in tokens.
This is because classList.add
does not support passing multiple classes separated by a whitespace. To avoid introducing a breaking change (like changing the type of activeClass
to receive an array) the string could be splited by whitespaces classList.add(...activeClass.split(' '))
.
PS: Great library!