![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
react
Franklin___
这个作者很懒,什么都没留下…
展开
-
React--React Hooks主动更新Hooks组件
当我们用useState创建对象数组的时候,使用数组的index去改变数组某一项中的对象属性时,useState无法监听到,此时视图就无法更新,所以我们就需要主动强制更新视图const [friendCircleArr, setFriendCircleArr] = useState({ name: 'Lucy', avator: P1, content: { text: '今天上课好累啊', image:原创 2021-03-29 14:45:52 · 2623 阅读 · 0 评论 -
react+ts+antd 踩坑之旅 2、配置alias别名
直接上截图记录把webpack.config,jstsconfig.jsontsconfig里的‘/’一个都不能少原创 2021-02-01 17:56:46 · 423 阅读 · 1 评论 -
react+ts+antd 踩坑之旅 1、函数式组件编程式跳转
之前js写react写编程式跳转是这样的props.history.push('/main')现在用ts写是这样的import React, { FC } from 'react'import { withRouter, RouteComponentProps } from 'react-router-dom';interface InitProps { }type MainProps = InitProps & RouteComponentProps;const Main: FC原创 2021-01-31 17:21:33 · 573 阅读 · 0 评论 -
React-- create-react-app webpack修改别名alias
找到node-modules/react-scripts/config/paths.js设置好要配置别名的路径找到同目录下的webpack.config.js在原有配置基础上设置别名路径完成原创 2021-01-16 15:06:10 · 456 阅读 · 0 评论 -
ReactHooks--踩坑1 :React Hook xx is called in function xx which is neither a React function component
直接上代码import React, { useState } from 'react';function example(){ const [ count,setCount ] =useState(0) return( <div> <div> you have clicked {count} times </div> <bu原创 2020-05-14 14:54:56 · 1420 阅读 · 0 评论 -
React--使用增强函数配置redux-thunk和Redux DevTools
直接上代码, 在store文件夹下的入口文件index.js中import { createStore,applyMiddleware,compose } from 'redux'import reducer from './reducer'import thunk from 'redux-thunk'// !!!!!!!!!const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DE原创 2020-05-13 16:50:57 · 328 阅读 · 1 评论