Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions 22-react-binding/a-simple-binding/src/Form.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import React, { Component } from 'react';

function capitalize(str) {
return str.substr(0, 1).toUpperCase() + str.substr(1);
}

class Form extends Component {
state = {
user: Object.assign({}, this.props.user)
Expand Down Expand Up @@ -32,10 +28,10 @@ class Form extends Component {
);
}

renderField = (state, name, label = capitalize(name)) => {
renderField = (state, name, label = name) => {
return (
<div style={{ marginBottom: '12px' }}>
<label>
<label style={{textTransform: 'capitalize'}}>
{label}
<input
type="text"
Expand Down
8 changes: 2 additions & 6 deletions 22-react-binding/b-tell-parent/src/Form.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import React, { Component } from 'react';

function capitalize(str) {
return str.substr(0, 1).toUpperCase() + str.substr(1);
}

class Form extends Component {
state = {
user: Object.assign({}, this.props.user)
Expand Down Expand Up @@ -32,10 +28,10 @@ class Form extends Component {
);
}

renderField = (state, name, label = capitalize(name)) => {
renderField = (state, name, label = name) => {
return (
<div style={{ marginBottom: '12px' }}>
<label>
<label style={{textTransform: 'capitalize'}}>
{label}
<input
type="text"
Expand Down