App.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import './App.scss';
  2. import {Provider, connect} from 'react-redux';
  3. import {createStore, combineReducers, applyMiddleware} from 'redux';
  4. import thunk from 'redux-thunk';
  5. import {useEffect, useState, useRef} from "react";
  6. import React, {useCallback} from 'react';
  7. import {Router, Route, Link, Redirect, Switch} from 'react-router-dom';
  8. import createHistory from "history/createBrowserHistory";
  9. import {store} from "./reducers/store";
  10. import Routes from "./components/routes";
  11. //import {useDropzone} from 'react-dropzone'
  12. /*const actionAboutMe = () => {
  13. async(dispatch, getState)=>{
  14. }
  15. }
  16. const actioUploadFile = file =>{
  17. return actionPromise('uploadFile', fetch().then(res=>res.json))
  18. }
  19. const actionSetAvatar = file =>{
  20. async(dispatch, getState) => {
  21. }
  22. }*/
  23. //const store = createStore(combineReducers({promise: promiseReducer, auth: authReducer}),applyMiddleware(thunk))
  24. //store.subscribe(()=>console.log(store.getState()))
  25. //store.dispatch(actionCatById('5dc49f4d5df9d670df48cc64'))
  26. //store.dispatch(actionFullLogin('vladBraun4','123'))
  27. const history = createHistory();
  28. function App() {
  29. return (
  30. <Router history={history}>
  31. <Provider store={store} >
  32. <Routes />
  33. </Provider>
  34. </Router>
  35. );
  36. }
  37. export default App;