Last active
December 15, 2017 15:06
-
-
Save awinogradov/cc878c1ab51ed26bf0b36d89e73a012a to your computer and use it in GitHub Desktop.
bem-react-core
This file contains 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 { decl } from 'bem-react-core' | |
export default decl({ | |
block: 'Header', | |
elem: 'Inner', | |
attrs({ id }) { | |
return { id } | |
} | |
}) |
This file contains 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 { decl } from 'bem-react-core' | |
export default decl({ | |
block: 'Header', | |
tag: 'header', | |
content({ service }) { | |
return `Yandex.${service}` | |
} | |
}) |
This file contains 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 { declMod } from 'bem-react-core' | |
export default declMod({ custom: true }, { | |
block: 'Header', | |
content() { | |
return `My ${this.__base(...arguments)}` | |
} | |
}) |
This file contains 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
<div id="root"> | |
<div> | |
<header class="Header">Yandex.Search</header> | |
</div> | |
</div> |
This file contains 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 React from 'react' | |
import ReactDOM from 'react-dom' | |
import Header from 'b:Header' | |
const Root = () => | |
<div> | |
<Header service="Search"/> | |
</div> | |
ReactDOM.render(<Root />, document.getElementById('root')) |
This file contains 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
<div id="root"> | |
<div> | |
<header class="Header Header_custom">My Yandex.Search</header> | |
</div> | |
</div> |
This file contains 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 React from 'react' | |
import ReactDOM from 'react-dom' | |
import Header from 'b:Header m:custom' | |
const Root = () => | |
<div> | |
<Header custom service="Search"/> | |
</div> | |
ReactDOM.render(<Root />, document.getElementById('root')) |
This file contains 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
require('./Header.js') | |
require('./Header.css') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment