materialish
materialish copied to clipboard
Improved classNames prop
Passing classNames should append that to every node within the element's tree. For instance, if a React component renders the following DOM tree:
<div className="menu">
<div className="menu_item">
</div>
</div>
and a consumer of the library passes className="myCustomMenu" as a prop to that Component, it should now render:
<div className="menu myCustomMenu">
<div className="menu_item myCustomMenu_item">
</div>
</div>
Not only is the class name applied to the root node, but it is also added to all of its children as well, with the right suffix.
The benefit of this API is that passing a single class name into the Component will allow you to modify the entire tree of the Component.
Update: we should make sure to remove the classnames dependency when we make this change.