Skip to main content

Posts

Showing posts with the label redux

Redux in react native

 Step 1 Install the packages  -npm install @reduxjs/toolkit react-redux Step 2 Create a store by creating store.js file paste that default code inside that file import { configureStore } from '@reduxjs/toolkit' export const store = configureStore ({   reducer : {}, }) Step 3 Now wrap your application around with  <provider> by react-redux Go Inside your App.js file  import { Provider } from 'react-redux' ; import { store } from "./store" ; Now use that provider and store like so < NavigationContainer >       < Provider store = { store } >           < Stack.Navigator >             < Stack.Screen name = 'home' component = { HomeScreen } />             < Stack.Screen name = 'restaurant' component = { RestaurantScreen } />           </ Stack.Navigator >       </ P...