Skip to content

Can I use customClasses with styled components? #253

@ZeroCho

Description

@ZeroCho
<StyledTypeahead
                id="brand"
                options={lower.brands}
                maxVisible={5}
                ref={(c) => { this.typeahead = c; }}
                onOptionSelected={this.onBrandSelected}
                onBlur={this.onBlur}
                onFocus={this.onFocus}
                onKeyDown={this.onKeyDown}
                placeholder={lower.fetchingBrand ? '브랜드 로딩중...' : '브랜드명을 입력하세요'}
                value={lower.brand}
                customClasses={{
                  input: cx('input', this.state.inputError === 'brand' && 'error', lower.brand && 'bold'),
                  results: cx('results'),
                }}
/>

I managed to use react-typeahead with styled-components by styled(Typeahead), but I don't know whether i can use styled-components with customClasses(input and results). Currently, I'm using CSS Modules(with classnames package) and I want to change to styled-components.

I'm thinking about using it with injectGlobal. Is this only way to achieve my goal?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions