Skip to content

Instantly share code, notes, and snippets.

@a-x-
Created August 30, 2016 09:06
Show Gist options
  • Select an option

  • Save a-x-/2f8a90686b4c7f3c33dc35b75f0ee4b3 to your computer and use it in GitHub Desktop.

Select an option

Save a-x-/2f8a90686b4c7f3c33dc35b75f0ee4b3 to your computer and use it in GitHub Desktop.
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