nfl / react-helmet

A document head manager for React
MIT License
17.34k stars 660 forks source link

I recently used react helmet for changing title of all route links its perfectly working but the title is not change source code plz resolve this issue #688

Open Abhishekstudio opened 2 years ago

Abhishekstudio commented 2 years ago

Do you want to request a feature or report a bug?

What is the current behavior?

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React and react-helmet. Paste the link to your JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:

What is the expected behavior?

Which versions of React and react-helmet, and which browser / OS are affected by this issue? Did this work in previous versions of React and/or react-helmet?

AspectOfJerry commented 2 years ago

You got the bug report template but you have to fill it! It would greatly help others understand your problem and assist you.

So you're saying that it doesn't work. I don't think that the issue here is react-helmet but actually your code.

Here's how you import it:

import {Helmet} from 'react-helmet';

Here's how you can change a page's title:

<Helmet>
    <title>The title</title>
</Helmet>

Here's a very very simple example of a React Functional Component:

import React from 'react';
import {Helmet} from 'react-helmet';

const Home = () => {
    return (
        <>
            <Helmet>
                <title>The title</title>
            </Helmet>

            <h1>Home</h1>
            <p>Welcome to the home page!</p>
        </>
    );
};

export default Home;