Docs: Fix example JSX output
David Mininger committed
Apr 8, 2015 at 14:23 UTC
86bac33408de1e0284c27d5c82d4559301b831ae
1 file changed
+2
-2
docs/docs/06-transferring-props.md
+2
-2
@@ -11,13 +11,13 @@ It's a common pattern in React to wrap a component in an abstraction. The outer
11
You can use [JSX spread attributes](/react/docs/jsx-spread.html) to merge the old props with additional values:
12
13
```javascript
14
-return <Component {...this.props} more="values" />;
14
+<Component {...this.props} more="values" />
15
```
16
17
If you don't use JSX, you can use any object helper such as ES6 `Object.assign` or Underscore `_.extend`:
18
19
```javascript
20
-return Component(Object.assign({}, this.props, { more: 'values' }));
20
+React.createElement(Component, Object.assign({}, this.props, { more: 'values' }));
21
```
22
23
The rest of this tutorial explains best practices. It uses JSX and experimental ES7 syntax.