A bit of a noobie question here but I have just started working with React and also in a large project and I've noticed that both class
and className
cannot be used on all elements and components. More specifically, custom components. This has forced me to put the className in a div container but this feels like a bad practice.
This is very strange behavior for me as I am coming from an Angular and Vue background where class
or [class]
can be placed on most anything and add classes to a component or element
What situations would cause class
and className
to not be allowed on a component/element in the template?