small typo and code tag is now js highlight
Was html before bc github screws up the js highlighting for jsx.
Cheng Lou committed
Sep 27, 2013 at 02:50 UTC
b92c433c5001641c5354adf53a1cff7de1cd6aac
4 files changed
+8
-8
docs/cookbook/cb-02-inline-styles tip.md
+2
-2
@@ -6,9 +6,9 @@ permalink: inline-styles.html
6
script: "cookbook/inline-styles.js"
7
---
8
9
-In React, inline styles are nto specified as a string, but as an object whose key is the camelCased version of the style name, and whose value is the style's value in string:
9
+In React, inline styles are not specified as a string, but as an object whose key is the camelCased version of the style name, and whose value is the style's value in string:
10
11
-```html
11
+```js
12
/** @jsx React.DOM */
13
14
var divStyle = {
docs/cookbook/cb-02-inline-styles.md
+2
-2
@@ -7,12 +7,12 @@ script: "cookbook/inline-styles.js"
7
---
8
9
### Problem
10
-You want to put inline style to an element.
10
+You want to apply inline style to an element.
11
12
### Solution
13
Instead of writing a string, create an object whose key is the camelCased version of the style name, and whose value is the style's value, in string:
14
15
-```html
15
+```js
16
/** @jsx React.DOM */
17
18
var divStyle = {
docs/cookbook/cb-03-if-else-in-JSX tip.md
+2
-2
@@ -8,7 +8,7 @@ script: "cookbook/inline-styles.js"
8
9
`if-else` statements don't work inside JSX, since JSX is really just sugar for functions:
10
11
-```html
11
+```js
12
/** @jsx React.DOM */
13
14
// this
@@ -21,7 +21,7 @@ Which means `<div id={if (true){ 'msg' }}>Hello World!</div>` doesn't make sense
21
22
What you're searching for is ternary expression:
23
24
-```html
24
+```js
25
/** @jsx React.DOM */
26
27
// this
docs/cookbook/cb-03-if-else-in-JSX.md
+2
-2
@@ -12,7 +12,7 @@ You want to use conditional in JSX.
12
### Solution
13
Don't forget that JSX is really just sugar for functions:
14
15
-```html
15
+```js
16
/** @jsx React.DOM */
17
18
// this
@@ -25,7 +25,7 @@ Which means `<div id={if (true){ 'msg' }}>Hello World!</div>` doesn't make sense
25
26
What you're searching for is ternary expression:
27
28
-```html
28
+```js
29
/** @jsx React.DOM */
30
31
// this