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

Can I use customClasses with styled components? #253

Open
ZeroCho opened this issue Jul 11, 2018 · 0 comments
Open

Can I use customClasses with styled components? #253

ZeroCho opened this issue Jul 11, 2018 · 0 comments

Comments

@ZeroCho
Copy link

ZeroCho commented Jul 11, 2018

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

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

No branches or pull requests

1 participant