Created
August 30, 2016 09:06
-
-
Save a-x-/2f8a90686b4c7f3c33dc35b75f0ee4b3 to your computer and use it in GitHub Desktop.
Пример для https://medium.com/p/eff1d8efe0d8/edit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import ButtonNormal from ‘libs/bem/desktop/button/_theme/button_theme_normal’ | |
| import ButtonS from ‘libs/bem/desktop/button/_size/button_size_s’ | |
| import ButtonLink from ‘libs/bem/desktop/button/_type/button_type_link’ | |
| // Наследование для удобства, но не обязательное. | |
| class ButtonNormalS extends ButtonNormal { | |
| constructor(props){super({…props, mods: {…this.mods, size:’s’}})} | |
| } | |
| // … | |
| // Подмешивание модификаторов без наследования | |
| render(){return <div block=”foo”><ButtonNormalS mods={{type:’link’}} mix={{elem:’bar’}} text=”Яндекс” /></div><div>…</div>”} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment