I have a script that says it generates different inputs (input, textarea, checkbox, select...) and then renders it on the page, I need in textarea works onchange when it works, the submit button will become active. Now the situation is like this, I go to the page, the button is disabled, when I go to the VS code and save code there, and return to the page, the button becomes active, that is, a rerender occurs, I tried to make a state using useState just to change it and so that it rerender the page, but so far without success, please help me
case 'textarea': {
const docTextarea = document.getElementById(
field.name
) as HTMLTextAreaElement;
docTextarea.value = parentConfigValue;
const event = new MouseEvent('input', {
view: window,
bubbles: true,
cancelable: true,
});
docTextarea.dispatchEvent(event);
break;
}
I'm using next js, but nor ssr here