Github Project: https://github.com/paulnguyen-mn/redux-photo-app
npm i --save-dev node-sass
npm i --save react-router-dom
npm i --save reactstrap
src
|__ assets
| |__ images
| |__ styles (global styles)
|
|__ components (shared components)
|
|__ features
|__ Photo
|__ components
| |__ PhotoList
| |__ PhotoCard
| |__ PhotoForm
|
|__ pages
| |__ MainPage
| |__ AddEditPage
|__ photoSlice.js
|__ index.js
- Sử dụng kĩ thuật lazy load components.
- Load theo features.
// App.js
function App() {
return (
<BrowserRouter>
<Switch>
<Route path="/photos" component={Photo} />
<Route path="/user" component={User} />
<Route component={NotFound} />
</Switch>
</BrowserRouter>
)
}