ctrlplusb/react-async-component

Cannot read property 'helmetInstances' of undefined

mschipperheyn opened this issue · 4 comments

staylor/react-helmet-async#32
I have the problem described above and it's indicated as happening in react-async-component.

Any suggestions?

@mschipperheyn How did you end up fixing this? Running into the same thing..

I did not yet.

@ctrlplusb did you have a look here yet? staylor/react-helmet-async#32

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>
);