Im trying to pass multiple classes to className like this:
className: 'class1 class2'
But getting the following error:
DOMException: Failed to execute 'add' on 'DOMTokenList': The token provided ('class1 class2') contains HTML space characters, which are not valid in tokens.
You're right. It should be .classList.add('a', 'b') instead of .classList.add('a b'). We could use the spread operator or a similar technique for this.
Im trying to pass multiple classes to className like this:
className: 'class1 class2'
But getting the following error:
DOMException: Failed to execute 'add' on 'DOMTokenList': The token provided ('class1 class2') contains HTML space characters, which are not valid in tokens.
Is there something Im missing? An option would be using the Spread Operator like shown here: https://stackoverflow.com/a/36486683/6085256