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.
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.
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.