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 = { 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
} }