Since lastText is never used in render/UI, wouldn’t using a ref instead of state for storing prev state save extra renders?
lastText
it looks like lastText != text is doing the same thing as [text], so everything lastText could probably be removed
lastText != text
[text]
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
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.
Since
lastText
is never used in render/UI, wouldn’t using a ref instead of state for storing prev state save extra renders?it looks like
lastText != text
is doing the same thing as[text]
, so everythinglastText
could probably be removed