pettiboy / react-ui-scrollspy

Customizable Scroll Spy component for react which is Simple, Easy To Use and Lightweight with callback, typescript, auto-update URL hash and throttle support among others.

Home Page:https://pettiboy.github.io/react-ui-scrollspy/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow activeClass to receive multiple classes

franciscohanna92 opened this issue · comments

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!