Cannot read property 'helmetInstances' of undefined
mschipperheyn opened this issue · 4 comments
mschipperheyn commented
staylor/react-helmet-async#32
I have the problem described above and it's indicated as happening in react-async-component.
Any suggestions?
oyeanuj commented
@mschipperheyn How did you end up fixing this? Running into the same thing..
mschipperheyn commented
I did not yet.
mschipperheyn commented
@ctrlplusb did you have a look here yet? staylor/react-helmet-async#32
justnixx commented
You are likely missing the HelmetProvider, which is required. Did you wrap your App component with HelmetProvider? Here's an example:
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import { BrowserRouter as Router } from 'react-router';
import { HelmetProvider } from 'react-helmet-async';
import App from './App.tsx';
import './index.css';
createRoot(document.getElementById('root')!).render(
<StrictMode>
<Router>
<HelmetProvider>
<App />
</HelmetProvider>
</Router>
</StrictMode>
);