1
Что я делаю неправильно, я продолжаю получать TypeError: Не могу прочитать свойство count для null. Я не устанавливаю исходное состояние правильно?Реагировать начальное состояние. counting
import React from 'react';
class User extends React.Component {
\t super(props){
\t \t this.state = {
\t \t \t count: 0
\t \t }
\t }
\t increment(){
\t \t this.setState({ count: this.state.count + 1 })
\t }
\t render(){
\t \t return(<div>
\t \t \t <button
\t \t \t \t onClick={this.increment}>
\t \t \t \t \t \t {this.state.count}
\t \t \t </button>
\t \t </div>)
\t }
}
export default User;
спасибо тебе человека –