跳到主要内容

React fiber config with no test selectors

作用

不支持测试选择器的渲染器可以从此模块重新导出所有内容

导出的常量

不支持测试选择器的渲染器可以从此模块重新导出所有内容

支持测试选择器

备注

源码中 21 - 22 行

// Test selectors (when unsupported)
// 测试选择器(当不支持时)
export const supportsTestSelectors = false;

查找 Fiber 根

备注

源码中 23 行

export const findFiberRoot = shim;

获取边界矩形

备注

源码中 24 行

export const getBoundingRect = shim;

获取文本内容

备注

源码中 25 行

export const getTextContent = shim;

判定是否为隐藏子树

备注

源码中 26 行

export const isHiddenSubtree = shim;

匹配可访问性角色

备注

源码中 27 行

export const matchAccessibilityRole = shim;

如果可聚焦则设置焦点

备注

源码中 28 行

export const setFocusIfFocusable = shim;

设置交叉观察器

备注

源码中 29 行

export const setupIntersectionObserver = shim;

工具

兼容垫片

// Renderers that don't support test selectors
// can re-export everything from this module.
// 不支持测试选择器的渲染器可以从此模块重新导出所有内容

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