We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cd60067 commit 9b4ae9eCopy full SHA for 9b4ae9e
packages/core/core.ts
@@ -169,6 +169,19 @@ export type Composition<T> = <U extends ComponentType<any>>(
169
170
function composeSimple(mods: any[]) {
171
const { __blockName } = mods[0]
172
+
173
+ for (const mod of mods) {
174
+ if (mod.__blockName !== __blockName) {
175
+ console.error(
176
+ new Error(
177
+ '[bem-react] composeSimple: all modifiers must belong to the same block. '
178
+ + `Expected "${__blockName}", got "${mod.__blockName}" for modifier "${mod.__mod}". `
179
+ + 'The modifier will be applied incorrectly.',
180
+ ),
181
+ )
182
+ }
183
184
185
const allMods: Record<string, (string | boolean)[]> = {}
186
const allModsPassProps: Record<string, boolean[]> = {}
187
0 commit comments