会员
周边
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
国服第一李师师
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
6
7
8
9
10
11
12
13
14
···
20
下一页
2020年10月23日
EventLopp
摘要:
阅读全文
posted @ 2020-10-23 12:22 国服第一李师师
阅读(64)
评论(0)
推荐(0)
2020年10月22日
幽灵空白节点解决方案,史上最明白
摘要: <div class="con"> <img src="../img/jiaoyue.png" /><span>I am very good</span> </div> 底下会有空白,因为行内块状元素默认是以文字的基线对齐的, 解决方案有两个 1. .con{ border:1px solid re
阅读全文
posted @ 2020-10-22 17:42 国服第一李师师
阅读(686)
评论(0)
推荐(0)
useCallback,useMemo源码
摘要: import React, {useState,memo,useCallback,useMemo} from 'react'; import ReactDOM from 'react-dom'; let ChildComp = ({info,changeStr})=>{ console.log(11
阅读全文
posted @ 2020-10-22 15:50 国服第一李师师
阅读(380)
评论(0)
推荐(0)
2020年10月21日
useContext源码解读
摘要: function useContext(context){ console.log(context._currentValue) return context._currentValue; } let CounterContext = React.createContext(); function
阅读全文
posted @ 2020-10-21 20:08 国服第一李师师
阅读(205)
评论(0)
推荐(0)
useEffect、useLayoutEffect源码
摘要: 其实useReducer和useState有点相似,useState之前介绍过是useReducer的语法糖。 我们看两个code useEffect(() => { console.log(a) timerID.current = setInterval(()=>{ setCount(count
阅读全文
posted @ 2020-10-21 19:41 国服第一李师师
阅读(258)
评论(0)
推荐(0)
react项目控制台报错data.slice.is not function
摘要: 这个图是我 之前犯了错误好久没注意,今天终于忍不住去查了下,原来就是因为state里面的一个数据人家开始是{},而我去给人家赋值成了数组
阅读全文
posted @ 2020-10-21 13:59 国服第一李师师
阅读(1575)
评论(0)
推荐(1)
2020年10月20日
useRef源码
摘要: useRef在网上看了好几篇博客+自己理解 let lastRef function useRef(value){ lastRef = lastRef || {current:value} return lastRef } 我们利用这个useRef可以绑定dom,还可以自定义hook,这里我主要讲下
阅读全文
posted @ 2020-10-20 21:10 国服第一李师师
阅读(493)
评论(0)
推荐(0)
useReducer源码实现
摘要: 要知道useReducer是useState的语法糖 function useState (initial){ return useReducer(null,initial) } function useReducer(reducer,initialState){ hookStates[hookIn
阅读全文
posted @ 2020-10-20 17:36 国服第一李师师
阅读(385)
评论(0)
推荐(0)
2020年9月24日
useContext源码解读
摘要: 接着上一篇文章,React.createContext() 给这个东西赋值比如叫 let CounterContext = React.createContext(); 那么CounterContext它里面肯定是有provider,consumer的, 而useContext做的就是把Counte
阅读全文
posted @ 2020-09-24 20:53 国服第一李师师
阅读(407)
评论(0)
推荐(0)
2020年9月20日
react的Provider,Consumer
摘要: import React from 'react' import ReactDOM from "react-dom" const {Provider,Consumer} = React.createContext() class ContextDemo extends React.Component
阅读全文
posted @ 2020-09-20 18:33 国服第一李师师
阅读(1244)
评论(0)
推荐(0)
上一页
1
···
6
7
8
9
10
11
12
13
14
···
20
下一页
公告