79106563

Date: 2024-10-20 07:26:43
Score: 6 đźš©
Natty: 5.5
Report link

@nonopolarity All the answers are focusing on just replying to a part of your question i.e. why does react use a virtual dom. But what about the question that After the text changed to “hi” in the actual DOM why did react not change the text back to its original state when the button is clicked after 3 seconds? The virtual dom in react’s memory would have the original text then why didn’t it change in the re-rendering?

Reasons:
  • No code block (0.5):
  • Ends in question mark (2):
  • User mentioned (1): @nonopolarity
  • Single line (0.5):
  • Looks like a comment (1):
  • Low reputation (1):
Posted by: Intangible _pg18