Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- *
- * We took 28 lines of code and made it into 3 lines of code by realizing that we were
- * doing the exact same command just on different things. And since we already had the
- * event being passed, we could grab the name of the event.target and use that inside of state!
- *
- */
- handleFormChange(e) {
- this.setState({form: {...this.state.form, [e.target.name]: e.target.value}});
- }
- // handleUsernameChange(e){
- // console.log(e.target.name);
- // this.setState({form: {...this.state.form, username: e.target.value}});
- // this.showStateChange();
- // }
- // handleEmailChange(e){
- // this.setState({form: {...this.state.form, email: e.target.value}});
- // }
- //
- // handlePasswordChange(e){
- // this.setState({form: {...this.state.form, password: e.target.value}});
- // }
- //
- // handleNameChange(e){
- // this.setState({form: {...this.state.form, fullName: e.target.value}});
- // }
- // handleAddressChange(e){
- // this.setState({form: {...this.state.form, address: e.target.value}})
- // this.showStateChange();
- // }
- // handleCityStateChange(e){
- // this.setState({form: {...this.state.form, cityState: e.target.value}});
- // this.showStateChange();
- // }
- // handleZipChange(e){
- // this.setState({form: {...this.state.form, cityState: e.target.value}});
- // this.showStateChange();
- // }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement