# react list sample 001 ```javascript= class App extends React.Component { constructor(props) { super(props); this.state = { users: ['Akbar'], userName: '' } this.handlerClick = this.handlerClick.bind(this); this.handelInputUser = this.handelInputUser.bind(this); } handlerClick() { this.setState({ users: [...this.state.users, this.state.userName], userName: '' }) } handelInputUser(event) { this.setState({ userName: event.target.value }) } render() { return ( <div> <input value={this.state.userName} onChange={this.handelInputUser} /> <br /> <button onClick={this.handlerClick}>+ User</button> <br /> <ul> {this.state.users.map(user => <li key={user}>{ user }</li>)} </ul> </div> ) } } ReactDOM.render(<App />, document.querySelector("#mountNode")) ``` 
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up