📜  响应文本输入 onchange - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:00.104000             🧑  作者: Mango

代码示例2
import React, { Component } from 'react';

import './App.css';
import Header from './Header';

class App extends Component {

  constructor(props) {
    super(props);
   this.state = {name: "Michael"}

  }
   changeTitle = (e) =>{
      this.setState({name: e.target.value});
    }

  render() {
    return (
      

Type here to change name.

); } } export default App;