Styles do not work when connecting modules?

When connecting styles of the modules, nothing works.
import React from 'react';
headerScss import from './headerStyle.scss';
import {BodyContainer} from '../Body/body';

export const Header: React.FC = ()=>{
return(
<>
 <div className={headerScss.headerContainer}>


But when you specify the class by using " ", it works

import React from 'react';
headerScss import from './headerStyle.scss';
import {BodyContainer} from '../Body/body';

export const Header: React.FC = ()=>{
return(
<>
 <div className={'headerContainer'}>


Here is my scss and css rulz

5e4bab51c3b85162166821.png
5e4bab5913a0d954770594.png
April 7th 20 at 15:38
2 answers
April 7th 20 at 15:40
Solution
Not:
headerScss import from './headerStyle.scss';
A:
import './headerStyle.scss';
You're a little confused, it's a different approach to the styles - jannie82 commented on April 7th 20 at 15:43
Yes, there is a mistake , I just was in a hurry, so import work import './headerStyle.scss', so no import headerScss from './headerStyle.scss'; - Elijah_Hermiston commented on April 7th 20 at 15:46
@janice73, 《 mark the answer 》 - Jude_Schamberger commented on April 7th 20 at 15:49
April 7th 20 at 15:42
In options try to specify modules: true
Perhaps you need to specify more localIdentName, I'm not sure, worth a look in the documentation - jannie82 commented on April 7th 20 at 15:45
@Tod.Douglas, thanks - Elijah_Hermiston commented on April 7th 20 at 15:48

Find more questions by tags JavaScriptReactTypeScriptWebpack