Edit: As far as I can see none of those issues listed have nothing to do with React API, all of these are just Javascript gotchas, and you can have the same issues in the Vue, Angular, [nameYourFrameworkHere] projects.
By using type checker helper like Flow or Typescript you can get rid of the half problems listed here, if you don't want to do that, guard your logic for unforeseen situations and name your variables correctly, so that you know what is an array and what is an object.
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.
This is a Javascript thingie, not React specific.
Edit: As far as I can see none of those issues listed have nothing to do with React API, all of these are just Javascript gotchas, and you can have the same issues in the Vue, Angular, [nameYourFrameworkHere] projects.
By using type checker helper like Flow or Typescript you can get rid of the half problems listed here, if you don't want to do that, guard your logic for unforeseen situations and name your variables correctly, so that you know what is an array and what is an object.