From 6b446100793543915ada3db59b9bb22ae97401dd Mon Sep 17 00:00:00 2001 From: Peter Blazejewicz Date: Sat, 3 Feb 2018 16:08:55 +0100 Subject: [PATCH] Align class event handler creation with React docs This is small change to align example React app with current advised way of assigning event handlers that are declared as ES6 class methods: https://reactjs.org/docs/handling-events.html Thanks! --- .../content/React-CSharp/ClientApp/src/components/Counter.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/React-CSharp/ClientApp/src/components/Counter.js b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/React-CSharp/ClientApp/src/components/Counter.js index baddc12cfc..498a3c956f 100644 --- a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/React-CSharp/ClientApp/src/components/Counter.js +++ b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/React-CSharp/ClientApp/src/components/Counter.js @@ -6,6 +6,7 @@ export class Counter extends Component { constructor() { super(); this.state = { currentCount: 0 }; + this.incrementCounter = this.incrementCounter.bind(this); } incrementCounter() { @@ -23,7 +24,7 @@ export class Counter extends Component {

Current count: {this.state.currentCount}

- + ); }