1.stack

1. Update the node related information (beginwork just happens to be the beginning to the end of the information)

2. Complete node update related information off the stack (CompleteUnitofwork is off the stack from the end to the end)

3. Use different cursors to record different information, such as new and old context APIS. All information is separated in the stack with cursors

2. LegacyContext context (old)

1. Performance consumption is high. The beginwork will judge whether the context changes to determine whether the sub-component should be updated

2. The same key exists, and the latter overwrites the former. The new value is used depending on which context the cosumer comes from

3. The new context

1. Componentized use mode

2. Context provision and subscription are independent

3. No performance impact

4. Main places

1.updateProvider

If the new value has changed, put the new value in the context of the provider, and then iterate through all the child nodes to see if the contextDepencyItem on that node has the current context, If this context is updated, then you would update the context. If this context is updated, you would update the context

2.updateConsume

Read the latest value in the context, Set the contextItem chain on the firstContextDependency (for which the provider knows which component is depency). , so that the useProvider can determine whether the component is dependent on the context, and executes Cosumer’s Children function, which returns the new Children to the reconcileChildren

3. If a normal class component has the context, then the updateProvider component has an update, which will be updated in this round

4. If it is useContext, read the context directly, add it to the contextDepencyItem chain, and return Context.currentValue