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

Throwing an exception when accessing non-existent classes #295

Closed
krutoo opened this issue Nov 15, 2022 · 2 comments
Closed

Throwing an exception when accessing non-existent classes #295

krutoo opened this issue Nov 15, 2022 · 2 comments
Labels

Comments

@krutoo
Copy link

krutoo commented Nov 15, 2022

Hi, first of all thanks for good simple library.

In my projects i often use classnames/bind along with css modules like this:

import classnames from 'classnames/bind';
import styles from './something.module.css';

const cx = classnames.bind(styles);

export function Something () {
  return <div className={cx('something')} />
}

I want that in dev mode or in tests, calling cx() with a class name that is not in the css-module will throw an exception.

Can i somehow do it with this library?

@dcousens
Copy link
Collaborator

@krutoo that isn't supported as is, but you could try patch-package?

@krutoo
Copy link
Author

krutoo commented Nov 17, 2022

@krutoo that isn't supported as is, but you could try patch-package?

@dcousens Thank you for suggestion, i will try to use it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants