我想为组件在本地覆盖外部模块css
类
In my code
import `style` from './style.module.css' // this is local css module
import `ExternalComponent` from 'ExternalComponent' // suppose this is external module i'm using
function Component(){
return(
<ExternalComponent/>
)
}
现在ExternalComponent
渲染具有类div
的parent
元素。所以如果我要导入ExternalComponent
如何在本地导入的parent
模块中覆盖ExternalComponent
的style
类,以便仅更改此组件的ExternalComponent
中的样式仅,否则我使用的地方不会改变。
我正在使用React。
style.module.css