i created a store and authreducer and every thik work as expected
but when i add the use sellector in app .js i got this err
ERROR Error: could not find react-redux context value; please ensure the component is wrapped in a <Provider>
(I have tried using useSelector in other files without any errors. )
import { ApolloClient, ApolloProvider } from "@apollo/client";
import { Provider, useSelector } from "react-redux";
import Navigation from "./navigation";
import Navigation2 from "./navigation2";
import { store } from "./src/Redux/store";
import InMemoryCacheFct from "./src/apolloClient/InMemoryCache";
export default function App() {
const user = useSelector(state => state.auth.isAuthenticated);// the err is when i add this line even he works in other files
const client = new ApolloClient({
uri: ".......serverUrl",
cache: InMemoryCacheFct(),
queryDeduplication: true,
});
return (
<ApolloProvider client={client}>
<Provider store={store}>
{user ? <Navigation /> : <Navigation2 />}
</Provider>
</ApolloProvider>
);
}