From 197b0aa2e0ade8c71f2aca69d06a3177bae1db6c Mon Sep 17 00:00:00 2001 From: Darrem Ivey Date: Wed, 19 Sep 2018 20:23:07 +0100 Subject: [PATCH] Update uncontrolled example --- week17/uncontrolledForm/App.js | 10 ++++------ week17/uncontrolledForm/styles.css | 1 + 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/week17/uncontrolledForm/App.js b/week17/uncontrolledForm/App.js index f8e5a57..531679f 100644 --- a/week17/uncontrolledForm/App.js +++ b/week17/uncontrolledForm/App.js @@ -7,8 +7,6 @@ export class App extends Component { constructor (props) { super(props); this.fields = {}; - - this.handleSubmit = this.handleSubmit.bind(this); } gatherData () { @@ -24,13 +22,13 @@ export class App extends Component { return (
- this.fields.postcode = e } /> + ref={ (e) => this.fields[filedId] = e } />
) } @@ -39,7 +37,7 @@ export class App extends Component { return ( ) } @@ -47,7 +45,7 @@ export class App extends Component { render() { return (
-
+ { this.handleSubmit(e) }}>

Would you like to know more?

{ this.renderField("Username", "username") } diff --git a/week17/uncontrolledForm/styles.css b/week17/uncontrolledForm/styles.css index 1a52da5..88b6012 100644 --- a/week17/uncontrolledForm/styles.css +++ b/week17/uncontrolledForm/styles.css @@ -7,6 +7,7 @@ box-sizing: border-box; margin: 32px; font-family: Open Sans,Helvetica Neue,Helvetica,Arial,sans-serif; + text-align: left; } .form__header {