V
V
Vann Damm2020-02-18 12:16:33
JavaScript
Vann Damm, 2020-02-18 12:16:33

Styles do not work when connected by modules?

When connecting styles with modules, nothing works.

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

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


But when specifying a class using " ", everything works

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

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


Here are my scss and css rules

5e4bab51c3b85162166821.png
5e4bab5913a0d954770594.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir, 2020-02-18
@effect_tw

Not: A:
import headerScss from './headerStyle.scss';
import './headerStyle.scss';

E
Egor Zhivagin, 2020-02-18
@Krasnodar_etc

In options try specifying modules: true

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question