跳到主要内容

React fiber config with no mutation

不支持变异的渲染器可以从此模块重新导出所有内容。

一、作用

二、导出的类型

1. 实例测量

export type InstanceMeasurement = null;

2. 运行视图过渡

export type RunningViewTransition = null;

3. 视图过渡实例

export type ViewTransitionInstance = null | {name: string, ...};

4. 手势时间轴

export type GestureTimeline = any;

三、导出的常量

1. 支持变异

备注

源码中 21 - 22 行

// Mutation (when unsupported)
// 突变(当不支持时)
export const supportsMutation = false;

2. 克隆可变实例

备注

源码中 23 行

export const cloneMutableInstance = shim;

3. 克隆可变文本实例

备注

源码中 24 行

export const cloneMutableTextInstance = shim;

4. 追加子节点

备注

源码中 25 行

export const appendChild = shim;

5. 添加子元素到容器

备注

源码中 26 行

export const appendChildToContainer = shim;

6. 提交文本更新

备注

源码中 27 行

export const commitTextUpdate = shim;

7. 提交挂载

备注

源码中 28 行

export const commitMount = shim;

8. 提交更新

备注

源码中 29 行

export const commitUpdate = shim;

9. 在之前插入

备注

源码中 30 行

export const insertBefore = shim;

10. 在容器前插入

备注

源码中 31 行

export const insertInContainerBefore = shim;

11. 移除子元素

备注

源码中 32 行

export const removeChild = shim;

12. 从容器中移除子元素

备注

源码中 33 行

export const removeChildFromContainer = shim;

13. 重置文本内容

备注

源码中 34 行

export const resetTextContent = shim;

14. 隐藏实例

备注

源码中 35 行

export const hideInstance = shim;

15. 隐藏文本实例

备注

源码中 36 行

export const hideTextInstance = shim;

16. 显示实例

备注

源码中 37 行

export const unhideInstance = shim;

17. 显示文本实例

备注

源码中 38 行

export const unhideTextInstance = shim;

18. 清空容器

备注

源码中 39 行

export const clearContainer = shim;

19. 应用视图过渡名称

备注

源码中 40 行

export const applyViewTransitionName = shim;

20. 恢复视图过渡名称

备注

源码中 41 行

export const restoreViewTransitionName = shim;

21. 取消视图过渡名称

备注

源码中 42 行

export const cancelViewTransitionName = shim;

22. 取消根视图过渡名称

备注

源码中 43 行

export const cancelRootViewTransitionName = shim;

23. 恢复根视图过渡名称

备注

源码中 44 行

export const restoreRootViewTransitionName = shim;

24. 克隆根视图过渡容器

备注

源码中 45 行

export const cloneRootViewTransitionContainer = shim;

25. 移除根视图过渡克隆

备注

源码中 46 行

export const removeRootViewTransitionClone = shim;

26. 度量实例

备注

源码中 48 行

export const measureInstance = shim;

27. 测量克隆实例

备注

源码中 49 行

export const measureClonedInstance = shim;

28. 实例是否在视口中

备注

源码中 50 行

export const wasInstanceInViewport = shim;

29. 实例是否已更改

备注

源码中 51 行

export const hasInstanceChanged = shim;

30. 实例是否影响父项

备注

源码中 52 行

export const hasInstanceAffectedParent = shim;

31. 开始视图过渡

备注

源码中 53 行

export const startViewTransition = shim;

32. 开始手势过渡

备注

源码中 55 行

export const startGestureTransition = shim;

33. 停止视图过渡

备注

源码中 56 行

export const stopViewTransition = shim;

34. 添加视图过渡完成监听器

备注

源码中 57 行

export const addViewTransitionFinishedListener = shim;

35. 创建视图过渡实例

备注

源码中 59 行

export const createViewTransitionInstance = shim;

36. 获取当前手势偏移

备注

源码中 61 行

export const getCurrentGestureOffset = shim;

四、工具

1. 兼容垫片

// Renderers that don't support mutation
// can re-export everything from this module.
// 不支持变异的渲染器可以从此模块重新导出所有内容。

function shim(...args: any): empty {
throw new Error(
'The current renderer does not support mutation. ' +
'This error is likely caused by a bug in React. ' +
'Please file an issue.',
);
}