In that case I get this eslint recommendation:
Which suggests you should only add the class when you need it as otherwise it would actually be slower.