mirror of
https://github.com/phuoc-ng/csslayout.git
synced 2025-10-23 10:46:13 +02:00
Move useDocumentTitle to hooks
This commit is contained in:
9
client/hooks/useDocumentTitle.js
Normal file
9
client/hooks/useDocumentTitle.js
Normal file
@@ -0,0 +1,9 @@
|
||||
import { useEffect } from 'react';
|
||||
|
||||
const useDocumentTitle = (title) => {
|
||||
useEffect(() => {
|
||||
document.title = title;
|
||||
}, [title]);
|
||||
};
|
||||
|
||||
export default useDocumentTitle;
|
Reference in New Issue
Block a user