import React from 'react';

import {Provider} from 'react-redux';
import {createStore, applyMiddleware} from 'redux';
import rootReducer from './src/Reducers/index';
import RootView from './src/RootView';
import createSagaMiddleware from 'redux-saga';
import rootSaga from './src/Saga/rootSaga';
import {SafeAreaProvider} from 'react-native-safe-area-context';

const sagaMiddleware = createSagaMiddleware();

let store = createStore(rootReducer, applyMiddleware(sagaMiddleware));
sagaMiddleware.run(rootSaga);
const App = () => {
  return (
    <SafeAreaProvider>
      <Provider store={store}>
        <RootView />
      </Provider>
    </SafeAreaProvider>
  );
};

export default App;
