百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
R

redux-photo-app

> 编程语言
开源

迷你项目: 照片应用程序 设置环境 GitHub 项目: https://GitHub.com/paulnguyen-mn/redux-photo-app 1. 通过 Create React App 设置 ReactJS 应用程序 ...

99 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

迷你项目: 照片应用程序 设置环境 GitHub 项目: https://GitHub.com/paulnguyen-mn/redux-photo-app 1. 通过 Create React App 设置 ReactJS 应用程序 ...

Mini Project: Photo App

Setup environment

Github Project: https://github.com/paulnguyen-mn/redux-photo-app

1. Setup ReactJS App via Create React App

Link: https://create-react-app.dev/docs/getting-started/

2. Add SCSS support

javascript
npm i --save-dev node-sass

3. Add react router

bash
npm i --save react-router-dom

4. Add UI lib

bash
npm i --save reactstrap

Tổ chức folder

src
|__ assets
|  |__ images
|  |__ styles (global styles) 
|
|__ components (shared components)
|
|__ features
  |__ Photo
    |__ components
    |  |__ PhotoList
    |  |__ PhotoCard
    |  |__ PhotoForm
    |
    |__ pages
    |  |__ MainPage
    |  |__ AddEditPage
    |__ photoSlice.js
    |__ index.js

Tổ chức routing

  • Sử dụng kĩ thuật lazy load components.
  • Load theo features.
javascript
// App.js
function App() {
  return (
    
      
        
        
        
      
    
  )
}

Custom Field

  • Cầu nối giữa UI control và Formik.
  • UI control là một controlled component với props:
    • name: tên xác định control
    • value: giá trị của control
    • onChange: trigger hàm này với giá trị mới khi có thay đổi
    • onBlur: xác định khi nào thì control này bị touched
javascript
function InputField(props) {
  const {
    field,
    type, label, placeholder, disabled,
  } = props;
  const { name } = field;

  return (
    
      {label && {label}}

      
    
  );
}

Random Photo control

RandomPhoto Props

  • name
  • imageUrl
  • onImageUrlChange
  • onRandomButtonBlur

RandomPhotoField

Formik

Yup

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

JavaScript

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言