Skip to content

Commit

Permalink
Merge pull request vasanthk#27 from Ch-Valentine/patch-2
Browse files Browse the repository at this point in the history
Fix and Improve markdown markup in 07.spreading-props-dom.md
  • Loading branch information
elreeda authored Mar 28, 2017
2 parents 209baa4 + 07aef13 commit d9489a9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions anti-patterns/07.spreading-props-dom.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# Spreading props on DOM elements
When we spread props we run into the risk of adding unknown HTML attributes, which is a bad practice.

###Reference:
- React Design Patterns and best practices by Michele Bertoli

### Reference:
- [React Design Patterns and best practices by Michele Bertoli.](https://github.com/MicheleBertoli/react-design-patterns-and-best-practices)

##### BAD
This will try to add the unknown HTML attribute `flag` to the DOM element
This will try to add the unknown HTML attribute `flag` to the DOM element.
```javascript
const Sample = () => (<Spread flag={true} className="content"/>);
const Spread = (props) => (<div {...props}>Test</div>);
Expand Down

0 comments on commit d9489a9

Please sign in to comment.