You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a JavaScript variable is array, JSX will implicitly concat all members of the array.
104
+
If a JavaScript variable is an array, JSX will implicitly concat all members of the array.
105
105
106
106
```js
107
107
var arr = [
@@ -135,7 +135,7 @@ ReactDOM.render(
135
135
136
136
Components would have attributes, and you can use `this.props.[attribute]` to access them, just like `this.props.name` of `<HelloMessage name="John" />` is John.
137
137
138
-
Please remember the first letter of the component's name must be capitalized, otherwise React will throw an error. For instance, `HelloMessage` as a component's name is OK, but `helloMessage` is not allowed. And a React component should only one top child node.
138
+
Please remember the first letter of the component's name must be capitalized, otherwise React will throw an error. For instance, `HelloMessage` as a component's name is OK, but `helloMessage` is not allowed. And a React component should only have one top child node.
139
139
140
140
```javascript
141
141
// wrong
@@ -190,7 +190,7 @@ ReactDOM.render(
190
190
);
191
191
```
192
192
193
-
Please be minded that the value of `this.props.children` has three possibilities. If the component has no children node, the value is `undefined`; If single children node, an object; If multiple children nodes, an array. You should be careful to handle it.
193
+
Please be mindful that the value of `this.props.children` has three possibilities. If the component has no children node, the value is `undefined`; If single children node, an object; If multiple children nodes, an array. You should be careful to handle it.
194
194
195
195
React gave us an utility [`React.Children`](https://facebook.github.io/react/docs/top-level-api.html#react.children) for dealing with the `this.props.children`'s opaque data structure. You could use `React.Children.map` to iterate `this.props.children` without worring its data type being `undefined` or `object`. Check [official document](https://facebook.github.io/react/docs/top-level-api.html#react.children) for more methods `React.Children` offers.
196
196
@@ -216,7 +216,7 @@ var MyTitle = React.createClass({
216
216
});
217
217
```
218
218
219
-
The above component of `Mytitle` has a props of `title`. PropTypes tells React that the title is required and its value should be string.
219
+
The above component of `MyTitle` has a props of `title`. PropTypes tells React that the title is required and its value should be a string.
220
220
221
221
Now we give `Title` a number value.
222
222
@@ -229,7 +229,7 @@ ReactDOM.render(
229
229
);
230
230
```
231
231
232
-
It means the props doesn't pass the validation, and the console will show you a error message.
232
+
It means the props doesn't pass the validation, and the console will show you an error message.
233
233
234
234
```bash
235
235
Warning: Failed propType: Invalid prop `title` of type`number` supplied to `MyTitle`, expected `string`.
@@ -285,7 +285,7 @@ ReactDOM.render(
285
285
);
286
286
```
287
287
288
-
The desired DOM node should have a `ref` attribute, and `this.refs.[refName]` would return the corresponding DOM node. Please be minded that you could do that only after this component has been mounted into the DOM, otherwise you get `null`.
288
+
The desired DOM node should have a `ref` attribute, and `this.refs.[refName]` would return the corresponding DOM node. Please be mindful that you could do that only after this component has been mounted into the DOM, otherwise you get `null`.
0 commit comments