React Vite

Hi, I am using Vite for my react app which I’m working on, and I don’t have an index.js file (I have main.jsx) therefore I don’t have traditional rendering of the App component (root.render), instead I have ReactDOM.createRoot(document.getElementById('root')).render( <React.StrictMode> <RouterProvider router={router} /> </React.StrictMode>, )
so I can’t figure out the way to use Redux properly since I need to pass state and dispatch, and also add store.subscribe(render);
Furthermore (and this is embarrassing), I still don’t know what to do in order to pass a state to a component which is not rendered in another component (usually App). For example, the only thing I’m rendering in the App component in my project is Home page since it is multipage app and I don’t want other components appear all at once.
I don’t know if providing code would be helpful in this case since these are just genuine questions about how to adapt from cra to vite, and how to pass state to a component which is “independent” sort of speaking.
Thanks in advance!
p.s. The reason why I’m using Vite is because I had a lot of bugs and problems which, after doing some research, don’t happen with Vite.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.