You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importReactfrom"react";importReactDomfrom"react-dom";import{love,yong1}from'./scss/style/index.scss';console.log(yong1);// is undefined functionApp(){return(<divclassName={`${love}${yong1}`}data-theme="light"><divdata-before="$">1w</div></div>);}ReactDom.render(<App/>,document.getElementById("root"));exportdefaultApp
Because CSS modules are transpiled to a module with one default export that contains an object with key values, not a module with multiple named exports.
Because CSS modules are transpiled to a module with one default export that contains an object with key values, not a module with multiple named exports.
I tried your method and found that styles are undefined, I configured namedExport: true of css modules on webpack, so it will be named export by default . so troubled
example:
'./scss/style/index.scss';
"./name.css"
webpack.config.js
why yong1 variable is undefined??
The text was updated successfully, but these errors were encountered: