Skip to content
This repository was archived by the owner on Sep 28, 2022. It is now read-only.

Commit ee455dc

Browse files
committed
Example using ES7 decorators.
1 parent 52d0ae7 commit ee455dc

File tree

7 files changed

+31
-6
lines changed

7 files changed

+31
-6
lines changed

.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"stage": 0
3+
}

endpoint/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
<html>
33
<head>
44
<link rel='stylesheet' href='./app.css'>
5+
6+
<link rel="icon" href="data:;base64,iVBORw0KGgo=">
57
</head>
68
<body>
79
<div id='app'></div>

endpoint/main.css

Lines changed: 0 additions & 5 deletions
This file was deleted.

endpoint/main.css.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/UsingDecorator/car.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.car {
2+
background: #eee;
3+
}
4+
5+
.front-door {
6+
color: #0f0;
7+
}
8+
9+
.back-door {
10+
color: #00f;
11+
}

src/UsingDecorator/index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import React from 'react';
2+
import styles from './car.css';
3+
import CSSModules from 'react-css-modules';
4+
5+
@CSSModules(styles)
6+
export default class extends React.Component {
7+
render () {
8+
return <div className='car'>
9+
<div className='front-door'>front-door</div>
10+
<div className='back-door'>back-door</div>
11+
</div>;
12+
}
13+
}

src/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom';
33
import Car from './Car';
4+
import UsingDecorator from './UsingDecorator';
45

56
ReactDOM.render(<div>
67
<Car />
8+
<UsingDecorator />
79
</div>, document.querySelector('#app'));

0 commit comments

Comments
 (0)