Processing math: 100%

Thursday, May 28, 2020

Redux Setup that also applies to React-Native

1
2
3
4
5
6
7
8
9
10
11
12
import { createStore, combineReducers } from "redux";
import trackFormReducer from "./reducers/trackFormReducer";
const rootReducer = combineReducers({
  trackFormReducer: trackFormReducer
});
 
const store = createStore(
  rootReducer /* preloadedState, */,
  window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
);
 
export default store;
and
1
import { Provider as StoreProvider } from "react-redux";
and wrap the app component by StoreProvider

No comments:

Post a Comment