String representation of component state for styling with class names. Expects an array of strings OR a string/object pair: - className(['comp', 'comp-arg', 'comp-arg-2']) @returns 'react-select__comp react-select__comp-arg react-select__comp-arg-2' - className('comp', { some: true, state: fa
(prefix: string, name: string)
| 32 | @returns 'react-select__comp react-select__comp--some' |
| 33 | */ |
| 34 | function applyPrefixToName(prefix: string, name: string) { |
| 35 | if (!name) { |
| 36 | return prefix; |
| 37 | } else if (name[0] === '-') { |
| 38 | return prefix + name; |
| 39 | } else { |
| 40 | return prefix + '__' + name; |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | export function classNames( |
| 45 | prefix?: string | null, |
no outgoing calls
no test coverage detected
searching dependent graphs…