hi all .
I want to use the helmet to render the meta tags in the head With SSR .
I used the following code for ssr :
import React from "react";
import { onPageLoad } from "meteor/server-render";
import { renderToString } from "react-dom/server";
import { ServerStyleSheet } from "styled-components"
import {Helmet} from "react-helmet";
import ServerRoutes from '../../Routes/Server-Routes';
onPageLoad(sink => {
const sheet = new ServerStyleSheet();
const html = renderToString(sheet.collectStyles(
<ServerRoutes location={sink.request.url} />
));
sink.renderIntoElementById("App", html);
const helmet = Helmet.renderStatic();
sink.appendToHead(helmet.title);
sink.appendToHead(helmet.meta);
});
But this code works well for home page ( / ) .
But in other URLs, the tags do not change . And again the Home Page tags are rendered.
For example, the server on the Register page also renders the Home page tags.
What is really the problem?