09 2020 档案
摘要:接着上一篇文章,React.createContext() 给这个东西赋值比如叫 let CounterContext = React.createContext(); 那么CounterContext它里面肯定是有provider,consumer的, 而useContext做的就是把Counte
阅读全文
摘要:import React from 'react' import ReactDOM from "react-dom" const {Provider,Consumer} = React.createContext() class ContextDemo extends React.Component
阅读全文
摘要:import React from 'react'; import ReactDOM from 'react-dom'; let hooksIndex = 0 const hooksState = [] const useState = (initialValue)=>{ hooksState[ho
阅读全文
摘要:function curring(fn,args=[]){ let l = fn.length return function(...arg){ let newArgs = [...arg,...args] if(newArgs.length == l){ return fn(...newArgs)
阅读全文
摘要:1.取当前月份最后一天 function getCurrentMonthLast(){ var date=new Date(); var currentMonth=date.getMonth(); var nextMonth=++currentMonth; var nextMonthFirstDay
阅读全文