UNPKG
@hooks/title
Version:
latest (0.1.0)
0.1.0
0.0.3
0.0.2
0.0.1
React hook to set the document title
@hooks/title
/
cjs
/
index.js
10 lines
(9 loc)
•
247 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
"use strict"
;
Object
.
defineProperty
(
exports
,
"__esModule"
, {
value
:
true
});
const
react_1 =
require
(
"react"
);
function
useTitle
(
title
) { react_1.
useEffect
(
() =>
{
document
.
title
= title; }, [title]); }
exports
.
default
= useTitle;