className props should apply CSS class in any state
See original GitHub issueI know, this is the breaking change and can’t apply immediately. When this project will drastic change at v3.0 please consider following proposal.
Currently, this component can receive className
and openedClassName
.
className
: class name for CLOSED componentopenedClassName
: class name for opened component
Generally className
prop is known as that to specify class attribute always, like <div>
element in the react.
https://reactjs.org/docs/dom-elements.html#classname
Current behavior has given some surprising and annoying for me. IMO, following three props are LGTM.
className
: class name without conditionclosedClassName
: class name for closed componentopenedClassName
: class name for opened component
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Set the ClassName with state value in modular css in react
This would help you add the className this way. Variable is any variable in state with classname
Read more >Styling and CSS - React
Pass a string as the className prop: ... It is common for CSS classes to depend on the component props or state: ......
Read more >Applying React Conditional classNames - Pluralsight
Not only can you use props to conditionally apply class names, but you can also use state and other derived values.
Read more >Styles - React Select
Examples. Styles. React Select offers 3 main APIs for styling: The styles prop; The classNames prop; The classNamePrefix prop. The styles prop.
Read more >How To Style React Components | DigitalOcean
In this tutorial, you'll learn three different ways to style React components: plain Cascading Style Sheets (CSS), inline styles with ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed in
v3.0.0
@glennflanagan I’m more inline with what @karltaylor suggested, which is not dealing only with this specific request but taking the package to the next level. Basically a maintenance refactor to account for all changes in the ecosystem (hooks, modern design patterns, etc).
Although I’m personally not in favor of adding css-in-js as I think it’s too opinionated and what I love about this package is that it’s so small and doesn’t have dependencies 😃
If working hands are the issue then I can quickly wrap something up for a PR, but is it something you’d be interested in? Keeping the exact same logic but rewriting the entire API for a new major version