mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Simplify default title (#5968)
This commit is contained in:
parent
b0cad3370d
commit
18cb2c03df
|
@ -1,6 +1,3 @@
|
||||||
|
|
||||||
const DEFAULT_TITLE = ''
|
|
||||||
|
|
||||||
const DOMAttributeNames = {
|
const DOMAttributeNames = {
|
||||||
acceptCharset: 'accept-charset',
|
acceptCharset: 'accept-charset',
|
||||||
className: 'class',
|
className: 'class',
|
||||||
|
@ -39,12 +36,10 @@ export default class HeadManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
updateTitle (component) {
|
updateTitle (component) {
|
||||||
let title
|
let title = ''
|
||||||
if (component) {
|
if (component) {
|
||||||
const { children } = component.props
|
const { children } = component.props
|
||||||
title = typeof children === 'string' ? children : children.join('')
|
title = typeof children === 'string' ? children : children.join('')
|
||||||
} else {
|
|
||||||
title = DEFAULT_TITLE
|
|
||||||
}
|
}
|
||||||
if (title !== document.title) document.title = title
|
if (title !== document.title) document.title = title
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue