自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(9)
  • 收藏
  • 关注

原创 vscode下载太慢解决

vscode下载太慢

2022-08-29 10:40:52 196 1

原创 antd按需引入及修改主题

根目录下创建文件 config-overrides.js 在修改配色时需要下载less和less—loader包,并且必须加上addLessLoader和adjustStyleLoaders// 项目根目录下,新增文件 config-overrides.jsconst { override, fixBabelImports, addLessLoader, adjustStyleLoaders } = require('customize-cra');module.exports...

2022-05-11 08:29:33 222

原创 React底层源码分析之------ReactElement

const ReactElement = function(type, key, ref, self, source, owner, props) { const element = { // REACT_ELEMENT_TYPE是一个常量,用来标识该对象是一个ReactElement $$typeof: REACT_ELEMENT_TYPE, // 内置属性赋值 type: type, key: key, ref: ref, props: p.

2022-04-13 11:15:51 730

原创 React底层源码分析之------createElement

export function createElement(type, config, children) { //propName 变量用于储存后面需要用到的元素属性 let propName; // props 变量用于储存元素属性的键值对集合 const props = {}; //key、ref、self、source均为react元素的属性 let key = null; let ref = null; let self = null; let sourc.

2022-04-13 11:08:35 485

原创 react优化:PureComponent

为什么使用PureComponent?1.只要执行setState({}),即使不改变状态,也会重新渲染组件。2.只要当前组件重新render,子组件也会随之render,即使子组件没有用到父组件的任何数据。导致结果:效率低原因:component中的钩子函数shouldComponentUpDate()总是返回true解决办法:只有当组件的state或props数据发生改变才会重新渲染 ...

2022-04-08 10:03:31 967

原创 react路由守卫

1.路由守卫高阶组件的编写import React from 'react'import { Route, Redirect } from 'react-router-dom'import { message } from 'antd'export default function AuthRoute({ component: Component, ...rest }) { return ( <Route {...rest} render={(...

2022-04-06 14:51:42 3579

原创 react打包去除map文件

在react使用命令npm run build打包文件之后,发现map包的体积过大,想要去除该文件,需要进行一下操作node_modules/react-scripts/config/webpack.config.js注释掉const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== 'false';添加const shouldUseSourceMap = false...

2022-03-22 09:25:07 1845

原创 react-router按需引入

./component/AsyncComponentimport React, { Component } from "react";export default function asyncComponent(importComponent) { class AsyncComponent extends Component { constructor(props) { super(props); this.state = { componen

2022-03-22 09:20:21 290

原创 socket.io在宝塔面板上部署出的问题

socket.io在宝塔面板上部署出的问题

2021-11-23 21:53:19 1695

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除