import React, { useEffect, useState } from 'react'; export const TextInput = function TextInput({ height, validate, properties, styles, setExposedVariable, fireEvent, registerAction, component, darkMode, }) { const [value, setValue] = useState(properties.value); const { isValid, validationError } = validate(value); useEffect(() => { setExposedVariable('isValid', isValid); // eslint-disable-next-line react-hooks/exhaustive-deps }, [isValid]); useEffect(() => { setValue(properties.value); setExposedVariable('value', properties.value); // eslint-disable-next-line react-hooks/exhaustive-deps }, [properties.value]); registerAction('setText', async function (text) { setValue(text); setExposedVariable('value', text).then(fireEvent('onChange')); }); registerAction('clear', async function () { setValue(''); setExposedVariable('value', '').then(fireEvent('onChange')); }); return (