Giter Club home page Giter Club logo

react-pc-music's Introduction

react-pc-music

study react demo

项目规范:

1.文件夹、文件名 统一小写,多个单词以连接符'-'链接

2.javascript 变量采用驼峰式命名,常量全部使用大写,组件采用大驼峰命名

3.css采用普通css和styled-component结合来编写(全局采用普通css, 局部采用styled-component)

4.整个项目不再使用class组件,统一使用函数式组件,并且全面拥抱hooks

5.所有的函数式组件,为了避免不必要的渲染,全部使用memo进行包裹

6.组件内部的状态,使用useState,useReducer;业务数据全部放在redux中管理

7.函数组件内部基本按照如下顺序编写代码;

​ 组件内部state管理

​ redux的hooks代码

​ 其他组件hooks代码

​ 其他逻辑代码

​ 返回jsx代码

8.redux代码规范如下

​ 每个模块有自己独立的reducer 通过combineReducer进行合并

​ 异步请求代码使用redux-thunk,并且写在actionCreators中

​ redux直接采用redux hooks编写,不再使用connect

9.网络请求采用axios

​ 对axios二次封装

​ 所有的模块请求会放到一个请求文件中单独管理

10.项目使用AntDesign 11. import 顺序 第三方插件库 工具类 -- 网络请求 actionCreators utils 组件 ​

背景图通过require不显示需加.default

react-pc-music's People

Contributors

panyanxin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.