I'm not sure if converting vanilla JS + HTML to React makes sense in some cases.
Nonetheless, whenever cannot read property ... of undefined pops up, you're trying to read a property or execute a function of an object that is undefined. This means that the selector that should fill input results in an empty array, leading to undefined when you're trying to get the element at index 0.
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.
I'm not sure if converting vanilla JS + HTML to React makes sense in some cases.
Nonetheless, whenever
cannot read property ... of undefinedpops up, you're trying to read a property or execute a function of an object that is undefined. This means that the selector that should fillinputresults in an empty array, leading toundefinedwhen you're trying to get the element at index 0.