question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HTML <title> is empty on disabled JavaScript

See original GitHub issue

If I set a custom rendered <Html><head><title>... component in the static.config.js like Document: {...} - then the title gets not set without enabled JavaScript. There are a couple of reasons that speaks to have this set in the build process.

Title is empty in the index.html file, or all other files for instance.

<title data-react-helmet="true"></title>

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
tannerlinsleycommented, Nov 2, 2017

Well, if you’d like to test it soon and submit a PR, that looks like a good way to support both the default hard coded title and react-helmets title.

1reaction
tujoworkercommented, Nov 2, 2017

@EmilTholin Thanks for the tip! This works, Yes.

Anyway, the meta tags are working once I set them in the static.config.js, so why not have title working in there anyway? For sure, should then all the pages, witch have not set an additional <Head><title>... get this title? I would say, Yes. Thats how meta tags works as well.

The Question is, is this a bug?

I don’t know, but here is the config:

    ...
    getSiteProps: () => ({
        title: 'React Static',
        metaDescription: 'A progressive static-site framework for React'
    }),
    Document: class CustomHtml extends Component {
        render() {
            const {
                Html,
                Head,
                Body,
                children,
                siteProps,
                renderMeta
            } = this.props

            return (
                <Html>
                    <Head>
                        <title>{siteProps.title}</title>
                        <meta charSet="UTF-8" />
                        <meta
                            name="description"
                            content={siteProps.metaDescription}
                        />
                        <meta
                            name="viewport"
                            content="width=device-width, initial-scale=1"
                        />
                        {renderMeta.styleTags}
                    </Head>
                    <Body>{children}</Body>
                </Html>
            )
        }
    },
    ...
Read more comments on GitHub >

github_iconTop Results From Across the Web

Disable button whenever a text field is empty dynamically
Easiest way to do it :- Simple Html and JavaScript : Run the snippet (Just 7 lines). function success() { if(document.
Read more >
HTML <title> is empty on disabled JavaScript #115 - GitHub
If I set a custom rendered <Html><head><title>... component in the static.config.js like Document: {...} - then the title gets not set ...
Read more >
How to disable or enable buttons using Javascript and jQuery
Learn how to enable or disable buttons using javascript and jQuery based on whether the input field is filled or empty.
Read more >
if input is empty disable button javascript - You.com | The AI ...
Solution 1. You are disabling only on document.ready and this happens only once when DOM is ready but you need to disable in...
Read more >
<input type="button"> - HTML: HyperText Markup Language
If the disabled attribute isn't specified, the button inherits its disabled state from its parent element. This makes it possible to enable and ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found