fix: Textarea exposed variable not updated on app load (#10327)

* fix: Textarea exposed variable not updated on app load

* fix: Textarea exposed variable not updated on app load

---------

Co-authored-by: Johnson Cherian <johnsonc.dev@gmail.com>
This commit is contained in:
Shaurya Sharma 2024-07-23 10:37:22 +05:30 committed by GitHub
parent 13b2832c8c
commit 4aa2e406eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -12,13 +12,18 @@ export const TextArea = function TextArea({
useEffect(() => {
setValue(properties.value);
setExposedVariable('value', properties.value);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [properties.value]);
useEffect(() => {
const exposedVariables = {
value: properties.value,
setText: async function (text) {
setValue(text);
setExposedVariable('value', text);
},
clear: async function (text) {
clear: async function () {
setValue('');
setExposedVariable('value', '');
},
@ -26,7 +31,7 @@ export const TextArea = function TextArea({
setExposedVariables(exposedVariables);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [properties.value, setValue]);
}, [setValue]);
return (
<textarea