Skip to content
This repository has been archived by the owner on Dec 6, 2024. It is now read-only.

Error: Element type is invalid #135

Open
alfi-dim opened this issue Feb 23, 2024 · 1 comment
Open

Error: Element type is invalid #135

alfi-dim opened this issue Feb 23, 2024 · 1 comment

Comments

@alfi-dim
Copy link

Got this error when adding LoadingBar Component on my RemixJS root.tsx

Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object

import { Provider } from 'react-redux';
import LoadingBar from 'react-redux-loading-bar';
import stylesheet from '~/tailwind.css';
import NavbarFlowbite from '~/components/Navbar';
import store from '~/states';

export default function App() {
  return (
    <html lang="en">
      <head>
        <meta charSet="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1" />
      </head>
      <body>
        <LoadingBar />
        <Provider store={store}>
          <section>
            <NavbarFlowbite />
            <Outlet />
          </section>
          <ScrollRestoration />
          <Scripts />
          <LiveReload />
        </Provider>
      </body>
    </html>
  );
}

@mironov
Copy link
Owner

mironov commented Feb 26, 2024

@alfi-dim Hi, thank you for bringing this to my attention. While I'm not entirely certain, I did notice that <LoadingBar> may require access to your redux store. I suggest moving its mounting under <Provider>.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants