Skip to content

Commit

Permalink
docs: Remove why-not section
Browse files Browse the repository at this point in the history
  • Loading branch information
janizde committed Mar 14, 2024
1 parent 0f4dd48 commit 3cc3c16
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions README.md
Expand Up @@ -15,18 +15,6 @@ React components bound to class names. As simple as that. Without tagged templat
- Automatic inferring of display names like you're used to with regular React functional components
- Backwards compatibility with browsers not supporting ES6 `Proxy`, but still being able to use the `classBound[JSX.IntrinsicElement]()` shorthand (e.g., `classBound.button('foo')` instead of `classBound('foo', null, null, 'button')`)

## Why not [`styled-components`](https://styled-components.com/)

While CSS-in-JS approaches like styled-components have gained a lot of attention in the last couple of years you might be in a position where you can't or don't want to move to CSS-in-JS

- You might be using an external CSS library like Bootstrap
- You might be converting an old codebase to React and just want to focus on component functionality instead of also migrating all of your CSS to CSS-in-JS
- You might as well just not like CSS-in-JS

Still, you might want to have React components that abstract away the internals of your style sheets, or you're even using TypeScript and want to benefit from static types for styling components instead of raw class name concatenation.

This is where `class-bound-components` comes into play. It allows you to bind class names, be it global class name strings or even class names generated by `css-modules` to be bound to components. `class-bound-components` enables you to introduce an abstraction layer between style sheets and component usage that can also support a future migration from CSS-in-CSS to CSS-in-JS.

## Example

```tsx
Expand Down

0 comments on commit 3cc3c16

Please sign in to comment.