Open alfi-dim opened 6 months ago
Got this error when adding LoadingBar Component on my RemixJS root.tsx
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> ); }
@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>.
<LoadingBar>
<Provider>
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