Why does trim() not work for setting a string within an object (related to type, not the nature of the state)

I could not figure this out. Eventually created a code sandbox to try and isolate the issue and found that even stripped down, the issue persists. I have a controlled input that should not allow the space character. e.target.value.trim() correctly trims the space characters when the state is stored as a string but allows them… Read More Why does trim() not work for setting a string within an object (related to type, not the nature of the state)