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
Copy file name to clipboardExpand all lines: content/docs/jsx-in-depth.md
+3-4Lines changed: 3 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -245,8 +245,7 @@ function App2() {
245
245
}
246
246
```
247
247
248
-
You can also pick specific props that your component will consume while passing all other props using the spread operator.
249
-
This ensures that the component consumes the `kind` prop only, and passes down all other props via `...other`.
248
+
You can also pick specific props that your component will consume while passing all other props using the spread operator.
250
249
251
250
```js{2}
252
251
const Button = props => {
@@ -266,10 +265,10 @@ const App = () => {
266
265
};
267
266
```
268
267
269
-
In the example above, the `kind` prop is safely consumed and *is not* passed directly to the `<button>` element in the DOM.
268
+
In the example above, the `kind` prop is safely consumed and *is not* passed on to the `<button>` element in the DOM.
270
269
All other props are passed via the `...other` object making this component really flexible. You can see that it passes an `onClick` and `children` props.
271
270
272
-
Spread attributes can be useful but not to pass invalid HTML attributes to the DOM. They can also make your code messy by making it easy to pass a lot of irrelevant props to components that don't care about them. We recommend using this syntax sparingly.
271
+
Spread attributes can be useful but they also make it easy to pass unnecessary props to components that don't care about them or to pass invalid HTML attributes to the DOM. We recommend using this syntax sparingly.
0 commit comments