fmoo/react-typeahead

Can I use customClasses with styled components?

ZeroCho opened this issue · 0 comments

<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?