react-helmet icon indicating copy to clipboard operation
react-helmet copied to clipboard

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

Open Abhishekstudio opened this issue 2 years ago • 1 comments

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?

Abhishekstudio avatar Aug 19 '22 10:08 Abhishekstudio

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;

AspectOfJerry avatar Aug 29 '22 15:08 AspectOfJerry