-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
using css-modules exported variables? #4502
Comments
Hi raptoria, CSS modules is a breaking change and you'd need to use CRA 2.0 in order to get it to work. |
I'm using react-script-ts. I poked around that package.json and I can't see what version of CRA it's using. The react-script-ts I'm using is version 2.15.1. Is there another way to use CRA V 2.0 with typescript other than react-script-ts? |
i believe react-script-ts is a fork of react-scripts, and they have yet to merge any changes from CRA v2. You can follow along: wmonk/create-react-app-typescript#284 |
Hi @raptoria! Sorry we couldn't be more helpful! edit: also -- there's no other way to use typescript, sorry. |
Hi all, I'm new to CRA.
I see that the example boilerplate is importing the css like so,
import './App.css';
when I attempt to import the CSS as a variable, eg.
import * as styles from './App.css';
<header className="App-header" style={{background:styles.specialwhite}}>
I get the error, 'Cannot find module ./App.css'
I'm using Typescript. Any ideas on how to get this to work? I'd prefer not to use requires. I don't see .css.d.ts being generated anywhere. Is there a way to specify this without ejecting CRA and adding typed-css-modules?
The text was updated successfully, but these errors were encountered: