useEffect
#68371
Replies: 2 comments 2 replies
-
I think what you report is due to React’s StrictMode which runs some parts of your code twice to help surface bugs. In WordPress, StrictMode is active whenever either |
Beta Was this translation helpful? Give feedback.
0 replies
-
@stokesman ok, got it, DOM element outputs twice but what about 'deleted'?
Should not it outputs only when a block is deleted? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
Can anyone please point me in a right direction how
useEffect
hook works?The code is:
After page updating is what I am seeing in a console:
Why 'deleted' is adding to the console if 'ref.current' exists?
Page-No-Title-.-Template-.-wordpress-local-.-Editor-.-WordPress.webm
Kind regards
Beta Was this translation helpful? Give feedback.
All reactions