Skip to content
This repository has been archived by the owner on Nov 2, 2019. It is now read-only.

Improved classNames prop #249

Open
jamesplease opened this issue Aug 15, 2018 · 0 comments
Open

Improved classNames prop #249

jamesplease opened this issue Aug 15, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@jamesplease
Copy link
Owner

jamesplease commented Aug 15, 2018

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.

@jamesplease jamesplease added the enhancement New feature or request label Aug 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant