Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server-render - has unexpected comma in title #286

Closed
bratva opened this issue May 30, 2017 · 4 comments
Closed

Server-render - has unexpected comma in title #286

bratva opened this issue May 30, 2017 · 4 comments

Comments

@bratva
Copy link

bratva commented May 30, 2017

Hello.

Server side render title tag has unexpected comma.

Expected on server My Site London.
Actually on server: My Site ,London.

On client - like expected.

Details:
server.js:

const {renderToString} = require('react-dom/server');
const {Helmet} = require('react-helmet');

serverRender() {
    const helmet = Helmet.renderStatic();

    return (
        ....
        ${helmet.title.toString()}
    );
}

client.js:

render() {
    // string
    const CITY = 'London'; 
    <Helmet>
        <title>My Site {CITY}</title>
    </Helmet>
}

dependences version

    "react": "^15.5.0",
    "react-dom": "^15.5.0",
    "react-helmet": "^5.1.3"
@bratva bratva changed the title Server-render title - has unexpected comma in title Server-render - has unexpected comma in title May 30, 2017
@bratva
Copy link
Author

bratva commented Jun 1, 2017

A temporary solution is:
client.js

render() {
    // string
    const CITY = 'London'; 
    const title = `My Site ${CITY}`;
    <Helmet>
        <title>{title}</title>
    </Helmet>
}

doctyper pushed a commit that referenced this issue Jun 1, 2017
cwelch5 added a commit that referenced this issue Jun 19, 2017
fix: Remove unexpected comma in server-rendered title
@jakemmarsh
Copy link

I'm still seeing this issue on 5.2.0?

@atav32
Copy link

atav32 commented Mar 31, 2018

Regression? Seeing this bug again

@Gsiete
Copy link

Gsiete commented May 16, 2018

I'm seeing this bug client-side

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants