嵌套类选择器在next.js sass中不起作用

嵌套类选择器在next.js sass中不起作用,sass,next.js,Sass,Next.js,我在next.js中使用scss模块,并希望使用嵌套类选择器,如下所示: .div { .x { color: red; } } 但这似乎不适用于以下组件: 从“React”导入React 从“./my component.module.scss”导入样式 导出默认类MyComponent扩展React.Component{ 公共渲染(){ 返回( 奥洛洛 ) } } 由于某些原因,样式不适用于标记。 这段代码有什么问题?对我来说有点不清楚,但似乎我需要从模块中提取两个类。像

我在next.js中使用scss模块,并希望使用嵌套类选择器,如下所示:

.div {
  .x {
    color: red;
  }
}
但这似乎不适用于以下组件:

从“React”导入React
从“./my component.module.scss”导入样式
导出默认类MyComponent扩展React.Component{
公共渲染(){
返回(
奥洛洛
)
}
}
由于某些原因,样式不适用于
标记。
这段代码有什么问题?

对我来说有点不清楚,但似乎我需要从模块中提取两个类。像这样:

从“React”导入React
从“./my component.module.scss”导入样式
导出默认类MyComponent扩展React.Component{
公共渲染(){
返回(
奥洛洛
)
}
}
上面的代码工作得很好