Почему компонент myTextAreaCounter не виден в консоли?
Собрал проект, запустил, но ссылка на компонент не находится...
import PropTypes from "prop-types";
import React, { Component } from "react";
import ReactDOM from "react-dom";
import DOM from "react-dom-factories";
class TextAreaCounter extends Component {
static propTypes = {
text: PropTypes.string
};
static defaultProps = {
text: ""
};
constructor(props) {
super(props);
this.state = {
text: this.props.text
};
this._textChange = this._textChange.bind(this);
}
_textChange(event) {
console.log("change state");
this.setState({
text: event.target.value
});
}
render() {
return DOM.div(null,
DOM.textarea({
value: this.state.text,
onChange: this._textChange
}),
DOM.h3(null, this.state.text.length));
}
}
let myTextAreaCounter = ReactDOM.render(<TextAreaCounter text = { "Alex" } />, document.getElementById("app"));
// myTextAreaCounter.setState({ text: "Hello outside world!" });