3👍
✅
It’s likely that the initial state of userState.bio
is undefined, and the error comes from the initial rendering when the data is not updated; Try add another string check in your condition to eliminate the error:
if (str && str.length > length) {
}
Source:stackexchange.com