var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
import React from 'react';
import { forwardRefAndName } from '../../lib/forwardRefAndName.js';
/**
 * 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
 */
export var TextareaWithSafari17Workaround = forwardRefAndName('TextareaWithSafari17Workaround', function (props, ref) {
    var _a = React.useState(true), firstRender = _a[0], setFirstRender = _a[1];
    React.useEffect(function () {
        firstRender && setFirstRender(false);
    }, []);
    return React.createElement("textarea", __assign({}, props, { value: firstRender ? '' : props.value, ref: ref }));
});
//# sourceMappingURL=TextareaWithSafari17Workaround.js.map