Last active
June 18, 2022 09:09
-
-
Save harsh317/ffa30dd39d24134a17ba1413b781a4dd to your computer and use it in GitHub Desktop.
Basic App.js file (Adding redux)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createStore, combineReducers, applyMiddleware } from "redux"; | |
import { Provider } from "react-redux"; | |
import ReduxThunk from "redux-thunk"; | |
import Homescreen from "./Screens/Homescreen/Homescreen";// | | |
import PagenotFound from "./Screens/PageNotFound/PagenotFound";// | | |
import ForgotPassword from "./Screens/ForgotPassword/ForgotPassword";// | | |
import UserActions from "./Screens/UserActions/UserActions";// | | |
import Upload from "./Screens/Upload/Uplaod";// | Some screens with dummy data (FOR NOW) | |
import WatchScreen from "./Screens/WatchScreen/WatchScreen";// | | |
import SearchScreen from "./Screens/SearchScreen/SearchScreen";// | | |
import Subscriptions from "./Screens/subscriptions/subscriptions";// | | |
import ChannelScreen from "./Screens/channelScreen/ChannelScreen";// | | |
import EditVideo from "./Screens/EditVideoScreen/EditVideo";// | | |
import VideosReducer from "./Store/reducers/Videos"; // Import all Reducers | |
import AuthReducer from "./Store/reducers/Auth"; | |
const RootReducer = combineReducers({ // Combine our store to 1 big new store | |
Vidoes: VideosReducer, | |
auth: AuthReducer, | |
}); | |
const store = createStore(RootReducer, applyMiddleware(ReduxThunk)); // Creates a Redux store that holds the complete state tree of your app | |
function App() { | |
return ( | |
<Provider store={store}> | |
<div className="App"> | |
</div> | |
</Provider> | |
); | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment