"use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;exports.__esModule = true;exports.TextareaWithSafari17Workaround = void 0;var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));var _react = _interopRequireDefault(require("react"));

var _forwardRefAndName = require("../../lib/forwardRefAndName");

/**
 * React textarea behaves incorrectly on first rendered in Safari version 17.*
 * Reproduce: https://codesandbox.io/p/sandbox/textarea-and-textarea-safari-bug-9v95vz
 * was fixed in Safari version 17.4: https://developer.apple.com/documentation/safari-release-notes/safari-17_4-release-notes
 */
var TextareaWithSafari17Workaround = exports.TextareaWithSafari17Workaround = (0, _forwardRefAndName.forwardRefAndName)(


  'TextareaWithSafari17Workaround', function (props, ref) {
    var _React$useState = _react.default.useState(true),firstRender = _React$useState[0],setFirstRender = _React$useState[1];

    _react.default.useEffect(function () {
      firstRender && setFirstRender(false);
    }, []);

    return /*#__PURE__*/_react.default.createElement("textarea", (0, _extends2.default)({}, props, { value: firstRender ? '' : props.value, ref: ref }));
  });