Skip to content

Commit 3ae40e1

Browse files
example showing the passing of props to css-constructor
1 parent ee1f96f commit 3ae40e1

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

example/entry.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ import React from 'react';
22
import ReactDOM from 'react-dom';
33
import Hello from './hello';
44

5+
let color = {
6+
sampleColor: 'papayawhip'
7+
}
8+
59
ReactDOM.render(
6-
<Hello color='papayawhip'/>,
10+
<Hello color={color} />,
711
document.getElementById('container')
812
);

example/hello.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default class Hello extends React.Component {
1515
text-align: center;
1616
1717
/* Use props in your CSS */
18-
color: {this.props.color};
18+
color: {this.props.color.sampleColor};
1919
2020
/* Pseudo selectors */
2121
&:hover {

0 commit comments

Comments
 (0)