Closed PavelPivkin closed 3 years ago
The declared type of classname formatter always allows to use null as a first argument. However using formatter with null and blockMods returns only block name.
null
const cat = cn('Cat') cat() // Cat cat({ size: 'm' }) // Cat Cat_size_m // but cat(null, { size: 'm' }) // Cat // mixes cat(null, ['Dog']) // Cat Dog // but cat(null, { size: 'm' }, ['Dog']) // Cat
Let's fix ClassNameFormatter type https://github.com/bem/bem-react/blob/master/packages/classname/classname.ts#L21
PR with fix: https://github.com/bem/bem-react/pull/605
The declared type of classname formatter always allows to use
null
as a first argument. However using formatter with null and blockMods returns only block name.Let's fix ClassNameFormatter type https://github.com/bem/bem-react/blob/master/packages/classname/classname.ts#L21