Answers for "react TextField"

0

material ui width textfield

// Option 1
<TextField style ={{width: '100%'}} />

// Option 2
<TextField fullWidth />
Posted by: Guest on November-19-2020
3

react how to pass the input target value

class NameForm extends React.Component {
  constructor(props) {
    super(props);
    this.state = {value: ''};

    this.handleChange = this.handleChange.bind(this);
  }

  handleChange(event) {
    this.setState({value: event.target.value});
  }

  render() {
    return (
      <form>
        <label>
          Name:
          <input type="text" value={this.state.value} onChange={this.handleChange} />
        </label>
        <input type="submit" value="Submit" />
      </form>
    );
  }
}
Posted by: Guest on March-18-2020

Code answers related to "react TextField"

Browse Popular Code Answers by Language