2 ms·
The same exact problem exists inherently in CSS itself and has been addressed in many ways through different kinds of conventions. One way is to mix two differ
by antris 12y ago
The same exact problem exists inherently in CSS itself and has been addressed in many ways through different kinds of conventions.
One way is to mix two different sets of styles for the element.
Set 1 gives the element the general styles of the component itself.
Set 2 gives the context-specific styles that are only used in that one instance.
It's just like using two different classes. E.g. `.button` and `.firstButtonInHeader`. And then having an element like <button class="button firstButtonInHeader">.
Since components in React are declarative, instead of using a restricted tool such as CSS classes, you have the full power of JavaScript to construct these mixins however you like.