App.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 'bootstrap/dist/css/bootstrap.min.css';
  12. //import {useDropzone} from 'react-dropzone'
  13. /*const actionAboutMe = () => {
  14. async(dispatch, getState)=>{
  15. }
  16. }
  17. const actioUploadFile = file =>{
  18. return actionPromise('uploadFile', fetch().then(res=>res.json))
  19. }
  20. const actionSetAvatar = file =>{
  21. async(dispatch, getState) => {
  22. }
  23. }*/
  24. //const store = createStore(combineReducers({promise: promiseReducer, auth: authReducer}),applyMiddleware(thunk))
  25. //store.subscribe(()=>console.log(store.getState()))
  26. //store.dispatch(actionCatById('5dc49f4d5df9d670df48cc64'))
  27. //store.dispatch(actionFullLogin('vladBraun4','123'))
  28. const history = createHistory();
  29. function App() {
  30. return (
  31. <Router history={history}>
  32. <Provider store={store} >
  33. <Routes />
  34. </Provider>
  35. </Router>
  36. );
  37. }
  38. export default App;