zamarrowski / Curso-React-Testing-GraphQL

Curso React, testing y GraphQL
36 stars 21 forks source link

Change text #38

Closed zamarrowski closed 3 years ago

zamarrowski commented 3 years ago
import React from 'react'

class App extends React.Component {

  state = {
    text: ''
  }

  changeText = (e) => this.setState({ text: e.target.value })

  render() {
    return <>
      <h1>{this.state.text}</h1>
      <input type="text" onChange={this.changeText} />
    </>
  }

}

export default App