From 97f1a323b712139af63d9b8c0b37aeddba3dae79 Mon Sep 17 00:00:00 2001 From: Seyi Adebajo Date: Sat, 4 Apr 2015 21:17:07 -0400 Subject: [PATCH 1/2] Fixed typo / grammar docs --- docs/10.5-clone-with-props.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/10.5-clone-with-props.md b/docs/10.5-clone-with-props.md index 9236859ab..7e832ac06 100644 --- a/docs/10.5-clone-with-props.md +++ b/docs/10.5-clone-with-props.md @@ -6,7 +6,7 @@ prev: test-utils.html next: create-fragment.html --- -In rare situations a element may want to change the props of a element that it doesn't own (like changing the `className` of a element passed as `this.props.children`). Other times it may want to make multiple copies of a element passed to it. `cloneWithProps()` makes this possible. +In rare situations an element may want to change the props of an element that it doesn't own (like changing the `className` of an element passed as `this.props.children`). Other times it may want to make multiple copies of an element passed to it. `cloneWithProps()` makes this possible. #### `ReactElement React.addons.cloneWithProps(ReactElement element, object? extraProps)` From 4f618ca401b3b6d479fe3fc7fe6c50c1a2b4f7d7 Mon Sep 17 00:00:00 2001 From: Seyi Adebajo Date: Sun, 5 Apr 2015 18:43:14 -0400 Subject: [PATCH 2/2] Documentation: Suggested edit adds clarity regarding when 'shouldComponentUpdate' is triggered and what the 're-rendering' process entails. --- docs/11-advanced-performance.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/11-advanced-performance.md b/docs/11-advanced-performance.md index 913d6bfd6..a19a2add8 100644 --- a/docs/11-advanced-performance.md +++ b/docs/11-advanced-performance.md @@ -11,7 +11,7 @@ One of the first questions people ask when considering React for a project is wh React makes use of a *virtual DOM*, which is a descriptor of a DOM subtree rendered in the browser. This parallel representation allows React to avoid creating DOM nodes and accessing existing ones, which is slower than operations on JavaScript objects. When a component's props or state change, React decides whether an actual DOM update is necessary by constructing a new virtual DOM and comparing it to the old one. Only in the case they are not equal, will React [reconcile](http://facebook.github.io/react/docs/reconciliation.html) the DOM, applying as few mutations as possible. -On top of this, React provides a component lifecycle function, `shouldComponentUpdate`, which is triggered before the re-rendering process starts, giving the developer the ability to short circuit this process. The default implementation of this function returns `true`, leaving React to perform the update: +On top of this, React provides a component lifecycle function, `shouldComponentUpdate`, which is triggered before the re-rendering process starts (virtual DOM comparision and possible eventual DOM reconciliation), giving the developer the ability to short circuit this process. The default implementation of this function returns `true`, leaving React to perform the update: ```javascript shouldComponentUpdate: function(nextProps, nextState) {