Liquid error: internal
For further actions, you may consider blocking this person and/or reporting abuse
Liquid error: internal
For further actions, you may consider blocking this person and/or reporting abuse
krishna -
Piyush Kumar Baliyan -
Just another React Dev -
Ayodeji Akintubi -
Once suspended, zeyadetman will not be able to comment or publish posts until their suspension is removed.
Once unsuspended, zeyadetman will be able to comment and publish posts again.
Once unpublished, all posts by zeyadetman will become hidden and only accessible to themselves.
If zeyadetman is not suspended, they can still re-publish their posts from their dashboard.
Once unpublished, this post will become invisible to the public and only accessible to Zeyad Etman.
They can still re-publish the post if they are not suspended.
Thanks for keeping DEV Community safe. Here is what you can do to flag zeyadetman:
Unflagging zeyadetman will restore default visibility to their posts.
Top comments (5)
Love this idea! Might it be better to store the original title before changing it, and then restore the original title in the effect cleanup?
Shouldn't
title
be in theuseEffect
dependency array so that it reruns the effect iftitle
changes?I agree with @worsnupd that you should probably restore the original title in the cleanup.
Agreed! I totally missed that. The effect should list title as a dependency.
Can you explain whats going on here, specifically why the anonymous function is returned?
When you use this hook in a component, you want to set the title for the current component, You don’t have to set title for all of your components. So This anonymous function is fired when the componentWillUnmount() to set default title to the components that you don’t want to set a title to it.