Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f7c56d7

Browse files
petehuntzpao
authored andcommitted
Update syntax.md
Some inconsistencies pointed out in FB comments (cherry picked from commit b6451be)
1 parent 5cdc556 commit f7c56d7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/docs/syntax.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ var Nav;
3737
// Input (JSX):
3838
var app = <Nav color="blue" />;
3939
// Output (JS):
40-
var app = Nav({color:'blue'});
40+
var app = Nav({color:'blue'}, null);
4141
```
4242

4343
Notice that in order to use `<Nav />`, the `Nav` variable must be in scope.
@@ -49,7 +49,7 @@ var Nav, Profile;
4949
// Input (JSX):
5050
var app = <Nav color="blue"><Profile>click</Profile></Nav>;
5151
// Output (JS):
52-
var app = Nav({color:'blue'}, Profile({}, 'click'));
52+
var app = Nav({color:'blue'}, Profile(null, 'click'));
5353
```
5454

5555
Use the [JSX Compiler](/react/jsx-compiler.html) to try out JSX and see how it
@@ -114,7 +114,7 @@ var Nav;
114114
// Input (JSX):
115115
var tree = <Nav><span /></Nav>;
116116
// Output (JS):
117-
var tree = Nav({}, React.DOM.span({}));
117+
var tree = Nav(null, React.DOM.span(null, null));
118118
```
119119

120120
> Remember:
@@ -145,7 +145,7 @@ Likewise, JavaScript expressions may be used to express children:
145145
// Input (JSX):
146146
var content = <Container>{window.isLoggedIn ? <Nav /> : <Login />}</Container>;
147147
// Output (JS):
148-
var content = Container({}, window.isLoggedIn ? <Nav /> : <Login />);
148+
var content = Container(null, window.isLoggedIn ? Nav(null, null) : Login(null, null));
149149
```
150150

151151
## Tooling

0 commit comments

Comments
 (0)