'why react-helmet-async is not working in app?
In my react application, when I am using Helmet to show the title of the browser dynamically, the page in which I am using the CODE Like -
**<Helmet>
<title>Login</title>
</Helmet>**
then my page is getting disappeared Mode, nothing error is showing. In my react app I installed the react-helmet-async and I also imported the config ---- import { Helmet } from "react-helmet-async"; How can I solve the problem?
Solution 1:[1]
You must wrap the APP in index.js by HelmetProvider and also import HelmetProvider. You can follow following lines of code: index.js:
import { HelmetProvider } from 'react-helmet-async';
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<HelmetProvider>
<React.StrictMode>
<BrowserRouter>
<App />
</BrowserRouter>
</React.StrictMode>
</HelmetProvider>
);
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Abir Hasan |