Redux integration
It is extremely easy to use Redux in an app with React Navigation. It's basically no different than without React Navigation.
import { Provider } from 'react-redux';
import { NavigationContainer } from '@react-navigation/native';
// Render the app container component with the provider around it
export default function App() {
return (
<Provider store={store}>
<NavigationContainer>{/* Screen configuration */}</NavigationContainer>
</Provider>
);
}
Notice that we wrap our components in a Provider
like we'd normally do with react-redux
. Ta da! Now feel free to use connect
throughout your app.