随笔分类 -  react

摘要:###如果不打算用redux-thunk import { createStore, compose} from 'redux'; import reducer from './reducer' const composeEnhancers = window.__REDUX_DEVTOOLS_EXT 阅读全文
posted @ 2021-02-10 11:10 abcdefgab 阅读(69) 评论(0) 推荐(0)
摘要:####diff算法主要是同级比较,生成数组,进行数组替换 ####reducer可以接收state,但是绝不能修改state ####纯函数指的是:给固定收入,就一定有固定的输出,而且不会有任何副作用【不能例如:new data(),对原有函数参数进行修改】 ###中间件是action和store 阅读全文
posted @ 2021-02-10 11:07 abcdefgab 阅读(46) 评论(0) 推荐(0)
摘要:原本代码: import { SREACH_FOCUS, SREACH_BLUR } from "./actionType" export const searchFocus = () => { type: SREACH_FOCUS } export const search_blur = () = 阅读全文
posted @ 2021-02-09 17:34 abcdefgab 阅读(485) 评论(0) 推荐(0)
摘要:原来 修改(不用在构造函数里面定义) 阅读全文
posted @ 2021-02-07 19:41 abcdefgab 阅读(474) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2021-02-01 18:27 abcdefgab 阅读(29) 评论(0) 推荐(0)
摘要:###1.vscode保存react项目的时候由于js-css-html插件格式化代码导致react代码缩进错误 解决方法:禁用js-css-html插件 ###2.react和vue不同,react方法的定义需要加而不是"",否则报Expected onClick listener to be a 阅读全文
posted @ 2021-02-01 10:35 abcdefgab 阅读(101) 评论(0) 推荐(0)