What do you want to do with avatarUploadPercentage ? If you need to display the actual number, then, as suggested in another answer, you can either cancel setState or change dom directly.
However, if it displays a progress bar, it can be executed using CSS, although it still modifies the element through ref, but does not start the entire component life cycle (wasteful)
Something like [refToProgressBarElement].style.width = `${avatarUploadPercentage}%`
source share