import React, { useReducer, useContext } from 'react';

import RootContainer from '@container/RootContainer';
import RootContext from '@context/RootContext';
import RootReducer from '@slice/RootSlice';

const App = () => {
  const globalStore = useContext(RootContext);

  const [state, dispatch] = useReducer(RootReducer, globalStore);

  return (
    <RootContext.Provider value={{ state, dispatch }}>
      <RootContainer />
    </RootContext.Provider>
  );
};

export default App;
