From 1be7cca59887be4c4e074bb2fe840652a603398d Mon Sep 17 00:00:00 2001 From: newvlad Date: Mon, 19 Jun 2017 17:06:54 +0300 Subject: [PATCH] Create higher-order-components.md (#9976) --- docs/docs/higher-order-components.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docs/higher-order-components.md b/docs/docs/higher-order-components.md index 0593436bfa..c3b4303b12 100644 --- a/docs/docs/higher-order-components.md +++ b/docs/docs/higher-order-components.md @@ -177,10 +177,10 @@ Resist the temptation to modify a component's prototype (or otherwise mutate it) ```js function logProps(InputComponent) { - InputComponent.prototype.componentWillReceiveProps(nextProps) { + InputComponent.prototype.componentWillReceiveProps = function(nextProps) { console.log('Current props: ', this.props); console.log('Next props: ', nextProps); - } + }; // The fact that we're returning the original input is a hint that it has // been mutated. return InputComponent;