title: Could not find react-redux context value; please ensure the component is wrapped in a <Provider> even if already wrapped in a provider
body: <p>I'm trying to get the UID of the current user in firebase in my root file (App.js) but I encountered a problem regarding react-redux even though I wrapped in Provider and set a store. By the way, I'm using redux-toolkit. What am I missing here? Thanks for the answer.</p>
  <p>Below is my App.js</p>
  <pre><code>import { StrictMode, useEffect } from 'react'
  import { Provider } from 'react-redux';
  import { useDispatch } from 'react-redux';
  import { getCurrentUser } from 'store/slices/authSlice';
  import store from 'store';
  import routes from 'routes/routes';
  import PrivateRoute from 'routes/PrivateRoutes';
  
  const App = () =&gt; {
    const dispatch = useDispatch();
  
    useEffect(() =&gt; {
      firebase.auth().onAuthStateChanged((user) =&gt; {
        if (user) {
          // User is signed in, see docs for a list of available properties
          // https://firebase.google.com/docs/reference/js/firebase.User
          var uid = user;
          console.log(uid);
          dispatch(getCurrentUser(uid))
  
        } else {
          // User is signed out
          // ...
        }
      });
    }, [dispatch]);
  
    return (
      &lt;StrictMode&gt;
        &lt;Provider store={store}&gt;
           &lt;Router&gt;
              &lt;Switch&gt;
                {routes.map((route, i) =&gt; (
                  route.auth ? (
                    &lt;PrivateRoute
                      key={i}
                      exact
                      path={route.path}
                      component={route.component}
                    /&gt;
                  ) : (
                    &lt;Route
                      key={i}
                      exact
                      path={route.path}
                      component={route.component}
                    /&gt;
                  )
                ))}
              &lt;/Switch&gt;
            &lt;/Router&gt;
        &lt;/Provider&gt;
      &lt;/StrictMode&gt;
    );
  }
  
  export default App;
  </code></pre>