Skip to content

Commit

Permalink
check context in root components
Browse files Browse the repository at this point in the history
  • Loading branch information
awinogradov committed Nov 24, 2017
1 parent 36da7b4 commit 14d9661
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Bem.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function({ preset, naming }) {
getChildContext() {
const block = this.block || this.props.block,
elem = this.elem || this.props.elem,
contextBlock = this.context.bemBlock;
contextBlock = this.context && this.context.bemBlock;

if(block && (!elem && contextBlock !== block) || typeof contextBlock === 'undefined')
return { bemBlock : block };
Expand Down

0 comments on commit 14d9661

Please sign in to comment.