@samitouri / QOS-React / commits / 390fda7260

Create higher-order-components.md (#9976)

newvlad committed Jun 19, 2017 at 17:06 UTC 390fda72602ac9aa4378a3c81c6cfb97221e482b
1 file changed +2 -2
docs/docs/higher-order-components.md
+2 -2
@@ -177,10 +177,10 @@ Resist the temptation to modify a component's prototype (or otherwise mutate it)
177
178 ```js
179 function logProps(InputComponent) {
180 - InputComponent.prototype.componentWillReceiveProps(nextProps) {
180 + InputComponent.prototype.componentWillReceiveProps = function(nextProps) {
181 console.log('Current props: ', this.props);
182 console.log('Next props: ', nextProps);
183 - }
183 + };
184 // The fact that we're returning the original input is a hint that it has
185 // been mutated.
186 return InputComponent;