File tree Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ .car {
2
+ background : # eee ;
3
+ }
4
+
5
+ .front-door {
6
+ color : # 0f0 ;
7
+ }
8
+
9
+ .back-door {
10
+ color : # 00f ;
11
+ }
Original file line number Diff line number Diff line change
1
+ import React from 'react' ;
2
+ import styles from './car.css' ;
3
+ import CSSModules from 'react-css-modules' ;
4
+
5
+ class Car extends React . Component {
6
+ render ( ) {
7
+ return < div moduleName = 'car' >
8
+ < div moduleName = 'front-door' > front-door</ div >
9
+ < div moduleName = 'back-door' > back-door</ div >
10
+ </ div > ;
11
+ }
12
+ }
13
+
14
+ export default CSSModules ( Car , styles , {
15
+ useModuleName : true
16
+ } ) ;
Original file line number Diff line number Diff line change @@ -2,8 +2,10 @@ import React from 'react';
2
2
import ReactDOM from 'react-dom' ;
3
3
import Car from './Car' ;
4
4
import UsingDecorator from './UsingDecorator' ;
5
+ import UsingModuleName from './UsingModuleName' ;
5
6
6
7
ReactDOM . render ( < div >
7
8
< Car />
8
9
< UsingDecorator />
10
+ < UsingModuleName />
9
11
</ div > , document . querySelector ( '#app' ) ) ;
You can’t perform that action at this time.
0 commit comments