Skip to content

Commit

Permalink
Merge pull request #3625 from dmin/patch-1
Browse files Browse the repository at this point in the history
Docs: Fix example JSX output
  • Loading branch information
jimfb authored and zpao committed Apr 18, 2015
1 parent fab11d2 commit f4d7c70
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/docs/06-transferring-props.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ It's a common pattern in React to wrap a component in an abstraction. The outer
You can use [JSX spread attributes](/react/docs/jsx-spread.html) to merge the old props with additional values:

```javascript
return <Component {...this.props} more="values" />;
<Component {...this.props} more="values" />
```

If you don't use JSX, you can use any object helper such as ES6 `Object.assign` or Underscore `_.extend`:

```javascript
return Component(Object.assign({}, this.props, { more: 'values' }));
React.createElement(Component, Object.assign({}, this.props, { more: 'values' }));
```

The rest of this tutorial explains best practices. It uses JSX and experimental ES7 syntax.
Expand Down

0 comments on commit f4d7c70

Please sign in to comment.