1
0
Fork 0
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:
Tim Neutkens 2018-12-31 19:06:03 +01:00 committed by GitHub
parent b0cad3370d
commit 18cb2c03df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,3 @@
const DEFAULT_TITLE = ''
const DOMAttributeNames = {
acceptCharset: 'accept-charset',
className: 'class',
@ -39,12 +36,10 @@ export default class HeadManager {
}
updateTitle (component) {
let title
let title = ''
if (component) {
const { children } = component.props
title = typeof children === 'string' ? children : children.join('')
} else {
title = DEFAULT_TITLE
}
if (title !== document.title) document.title = title
}