
发表日期: 2021-05-20 14:32:28 浏览次数:93
安丘400电话办理【安丘网站公司】安丘百度优化、安丘域名注册、安丘网店美工、安丘微信公众号托管

安丘市,山东省省辖县级市,山东省财政直管县,位于山东半岛中部,是国务院批准的首批沿海对外开放县市之一。 [1] 市境总面积1760平方千米,耕地面积130万亩,辖3个街道、9个镇,870个行政村,总人口96.2万(2019年)。 [1]
安丘市历史文化可溯至春秋莒国,莒之渠丘父封邑;汉高祖八年(前199年),以古渠丘地封将军张说为安丘侯;汉景帝中元二年(前148年)以侯国名为县名正式置县。 [2] 2017年10月,安丘市被住建部命名为国家园林城市,首批全国农村社区建设示范单位。 [3] 2020年,安丘市被评为中国夏季休闲百佳县市。 [4]
安丘市东距青岛110公里,西距济南200公里,北距潍坊25公里;国道206、省道下小路、央赣路等多条主要干线交汇于境内,胶济铁路和济青、潍莱高速临境而过,潍日高速横贯市境南北。 [1] 2019年,安丘市地区生产总值同比增长5.5%,城乡居民人均可支配收入分别增长6.5%和8.5%,完成一般公共预算收入25.48亿元,同比增长2%,扣除减税降费等因素同口径增长12%。 [5]
首先,让我们进入需要确保hooks在React的作用域调用的机制,因为你现在可能知道如果在没有正确的上下文调用钩子是没有意义的:
到此为止既然我们已经看过了这种简单的封装机制,我希望我们转到本文的核心 – Hooks。我想向您介绍一个新概念:let currentDispatcher
const dispatcherWithoutHooks = { /* ... */ }
const dispatcherWithHooks = { /* ... */ }
function resolveDispatcher() {
if (currentDispatcher) return currentDispatcher
throw Error("Hooks can't be called")
}
function useXXX(...args) {
const dispatcher = resolveDispatcher()
return dispatcher.useXXX(...args)
}
function renderRoot() {
currentDispatcher = enableHooks ? dispatcherWithHooks : dispatcherWithoutHooks
performWork()
currentDispatcher = null
}{
foo: 'foo',
bar: 'bar',
baz: 'baz',
}{
memoizedState: 'foo',
next: {
memoizedState: 'bar',
next: {
memoizedState: 'bar',
next: null
}
}
}
· baseUpdate- 最近的创建了最新baseState的调度操作。
· queue – 调度操作的队列,等待进入reducer。let currentlyRenderingFiber
let workInProgressQueue
let currentHook
// Source: https://github.com/facebook/react/tree/5f06576f51ece88d846d01abd2ddd575827c6127/react-reconciler/src/ReactFiberHooks.js:123
function prepareHooks(recentFiber) {
currentlyRenderingFiber = workInProgressFiber
currentHook = recentFiber.memoizedState
}
// Source: https://github.com/facebook/react/tree/5f06576f51ece88d846d01abd2ddd575827c6127/react-reconciler/src/ReactFiberHooks.js:148
function finishHooks() {
currentlyRenderingFiber.memoizedState = workInProgressHook
currentlyRenderingFiber = null
workInProgressHook = null
currentHook = null
}
// Source: https://github.com/facebook/react/tree/5f06576f51ece88d846d01abd2ddd575827c6127/react-reconciler/src/ReactFiberHooks.js:115
function resolveCurrentlyRenderingFiber() {
if (currentlyRenderingFiber) return currentlyRenderingFiber
throw Error("Hooks can't be called")
}
// Source: https://github.com/facebook/react/tree/5f06576f51ece88d846d01abd2ddd575827c6127/react-reconciler/src/ReactFiberHooks.js:267
function createWorkInProgressHook() {
workInProgressHook = currentHook ? cloneHook(currentHook) : createNewHook()
currentHook = currentHook.next
workInProgressHook
}
function useXXX() {
const fiber = resolveCurrentlyRenderingFiber()
const hook = createWorkInProgressHook()
// ...
}
function updateFunctionComponent(recentFiber, workInProgressFiber, Component, props) {
prepareHooks(recentFiber, workInProgressFiber)
Component(props)
finishHooks()
}const ChildComponent = () => {
useState('foo')
useState('bar')
useState('baz')
return null
}
const ParentComponent = () => {
const childFiberRef = useRef()
useEffect(() => {
let hookNode = childFiberRef.current.memoizedState
assert(hookNode.memoizedState, 'foo')
hookNode = hooksNode.next
assert(hookNode.memoizedState, 'bar')
hookNode = hooksNode.next
assert(hookNode.memoizedState, 'baz')
})
return (
<ChildComponent ref={childFiberRef} />
)
}
服务热线
顶部
备案号: 苏ICP备11067224号
CopyRight © 2011 书生商友信息科技 All Right Reserved
24小时服务热线:400-111-6878 E-MAIL:1120768800@qq.com QQ:1120768800
网址: http://www.768800.com 网站建设:上往建站
关键词: 网站建设| 域名邮箱| 服务器空间| 网站推广| 上往建站| 网站制作| 网站设计| 域名注册| 网络营销| 网站维护|
企业邮箱| 虚拟主机| 网络建站| 网站服务| 网页设计| 网店美工设计| 网站定制| 企业建站| 网站设计制作| 网页制作公司|
400电话办理| 书生商友软件| 葬花网| 调温纤维| 海洋馆运营维护| 北京保安公司| 殡仪馆服务| 殡葬服务| 苏州殡葬一条龙| 朝阳殡葬| 苏州殡葬服务|
欢迎您免费咨询,请填写以下信息,我们收到后会尽快与您联系
服务热线:400-111-6878