: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
_this.onResize = function (e) {
if (_this.props.onResize) {
_this.updateLineHeight = function () {
lineHeight: getLineHeight(_this.textarea)
_this.onChange = function (e) {
var onChange = _this.props.onChange;
_this.currentValue = e.currentTarget.value;
TextareaAutosizeClass.prototype.componentDidMount = function () {
var _a = this.props, maxRows = _a.maxRows, async = _a.async;
if (typeof maxRows === "number") {
if (typeof maxRows === "number" || async) {
- force "autosize" to activate the scrollbar when this.props.maxRows is passed
- support StyledComponents (see #71)
setTimeout(function () { return _this.textarea && autosize(_this.textarea); });
this.textarea && autosize(this.textarea);
this.textarea.addEventListener(RESIZED, this.onResize);
TextareaAutosizeClass.prototype.componentWillUnmount = function () {
this.textarea.removeEventListener(RESIZED, this.onResize);
autosize.destroy(this.textarea);
TextareaAutosizeClass.prototype.render = function () {
var _a = this, _b = _a.props, onResize = _b.onResize, maxRows = _b.maxRows, onChange = _b.onChange, style = _b.style, innerRef = _b.innerRef, children = _b.children, props = __rest(_b, ["onResize", "maxRows", "onChange", "style", "innerRef", "children"]), lineHeight = _a.state.lineHeight;
var maxHeight = maxRows && lineHeight ? lineHeight * maxRows : null;
return (React.createElement("textarea", __assign({}, props, { onChange: this.onChange, style: maxHeight ? __assign({}, style, { maxHeight: maxHeight }) : style, ref: function (element) {
_this.textarea = element;
if (typeof _this.props.innerRef === 'function') {
_this.props.innerRef(element);
else if (_this.props.innerRef) {
_this.props.innerRef.current = element;
TextareaAutosizeClass.prototype.componentDidUpdate = function () {
this.textarea && autosize.update(this.textarea);
TextareaAutosizeClass.defaultProps = {
TextareaAutosizeClass.propTypes = {
maxRows: PropTypes.number,
onResize: PropTypes.func,
return TextareaAutosizeClass;
exports.TextareaAutosize = React.forwardRef(function (props, ref) {
return React.createElement(TextareaAutosizeClass, __assign({}, props, { innerRef: ref }));
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
var __webpack_unused_export__;
__webpack_unused_export__ = true;
var TextareaAutosize_1 = __webpack_require__(4462);
exports.A = TextareaAutosize_1.TextareaAutosize;