DEV Community

Discussion on: usePageTitle custom reactjs hook

Collapse
 
zeyadetman profile image
Zeyad Etman • Edited

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.