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

Skip to content

Commit 36719c5

Browse files
sophiebitszpao
authored andcommitted
Merge pull request facebook#3167 from MichelleTodd/docs-grammar
[Docs] Reword section on React without JSX
1 parent 043ac1a commit 36719c5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

docs/docs/02-displaying-data.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,12 @@ The easiest way to get started with JSX is to use the in-browser `JSXTransformer
100100

101101
## React without JSX
102102

103-
JSX is completely optional. You don't have to use JSX with React. You can create these trees through `React.createElement`. The first argument is the tag, pass a properties object as the second argument and children to the third argument.
103+
JSX is completely optional; you don't have to use JSX with React. You can create React elements in plain JavaScript using `React.createElement`, which takes a tag name or component, a properties object, and variable number of optional child arguments.
104104

105105
```javascript
106-
var child = React.createElement('li', null, 'Text Content');
107-
var root = React.createElement('ul', { className: 'my-list' }, child);
106+
var child1 = React.createElement('li', null, 'First Text Content');
107+
var child2 = React.createElement('li', null, 'Second Text Content');
108+
var root = React.createElement('ul', { className: 'my-list' }, child1, child2);
108109
React.render(root, document.body);
109110
```
110111

0 commit comments

Comments
 (0)