Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(classname): formatter type #605

Merged
merged 1 commit into from
Apr 29, 2021
Merged

fix(classname): formatter type #605

merged 1 commit into from
Apr 29, 2021

Conversation

PavelPivkin
Copy link
Contributor

@PavelPivkin PavelPivkin commented Apr 29, 2021

import { cn } from '@bem-react/classname'

const cat = cn('Cat')

//ok:
cat() // Cat
cat({ size: 'm' }) // Cat Cat_size_m
cat('Tail') // Cat-Tail
cat('Tail', { length: 'small' }) // Cat-Tail Cat-Tail_length_small

//!ok
cat(null) // Cat
cat(null, { size: 'm' }) // Cat

// mixes
// ok:
cat(null, ['Dog']) // Cat Dog
cat({ size: 'm' }, ['Dog', 'Horse'])

// !ok:
cat(['Dog'])
cat(null, { size: 'm' }, ['Dog', 'Horse']) // Cat


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants