When you import a module the code inside it runs immediately. In this case your Count.js file is being run before React has a chance to mount your app and put the textarea into the document. So when you call querySelectorAll, the textarea is not found and input is therefore undefined.
You might consider instead converting that peace to react as well or using a useEffect hook to make sure the code is run only when it's ready to.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
When you import a module the code inside it runs immediately. In this case your Count.js file is being run before React has a chance to mount your app and put the textarea into the document. So when you call querySelectorAll, the textarea is not found and input is therefore undefined.
You might consider instead converting that peace to react as well or using a useEffect hook to make sure the code is run only when it's ready to.