{"record":{"id":"0fe0eb643724d7f8","repo":"facebook/react","slug":"363","errorCode":"363","errorMessage":"Test selector API is not supported by this renderer.","messagePattern":"Test selector API is not supported by this renderer\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/react-reconciler/src/ReactTestSelectors.js","lineNumber":315,"sourceCode":"    } else {\n      let child = fiber.child;\n      while (child !== null) {\n        stack.push(child, selectorIndex);\n        child = child.sibling;\n      }\n    }\n  }\n\n  return false;\n}\n\nexport function findAllNodes(\n  hostRoot: Instance,\n  selectors: Array<Selector>,\n): Array<Instance> {\n  // $FlowFixMe[constant-condition]\n  if (!supportsTestSelectors) {\n    throw new Error('Test selector API is not supported by this renderer.');\n  }\n\n  const root = findFiberRootForHostRoot(hostRoot);\n  const matchingFibers = findPaths(root, selectors);\n\n  const instanceRoots: Array<Instance> = [];\n\n  const stack = Array.from(matchingFibers);\n  let index = 0;\n  while (index < stack.length) {\n    const node = stack[index++] as any as Fiber;\n    const tag = node.tag;\n    if (\n      tag === HostComponent ||\n      tag === HostHoistable ||\n      tag === HostSingleton\n    ) {\n      if (isHiddenSubtree(node)) {","sourceCodeStart":297,"sourceCodeEnd":333,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-reconciler/src/ReactTestSelectors.js#L297-L333","documentation":"findAllNodes(hostRoot, selectors) is the entry point of React's internal test-selector API. It first checks the host-config flag supportsTestSelectors: the DOM bindings set it to true (react-dom-bindings/src/client/ReactFiberConfigDOM.js), but renderers that re-export ReactFiberConfigWithNoTestSelectors — react-native's Fabric renderer, react-art, most thin custom renderers — set it to false, and custom reconcilers get it from $$$config.supportsTestSelectors. Calling findAllNodes through a renderer that does not implement the selector host methods throws immediately.","triggerScenarios":"Calling findAllNodes on a renderer built with react-reconciler whose config leaves supportsTestSelectors false or undefined; using react-native-renderer internals (ReactFiberConfigFabric re-exports the no-selectors config); third-party renderers (ink, react-three-fiber, react-pdf) that never implemented the required host methods such as getInstanceFromNode, getTextContent, matchAccessibilityRole, isHiddenSubtree, getBoundingRect, setFocusIfFocusable, setupIntersectionObserver.","commonSituations":"Porting a component test harness written against react-dom's internal testing build (e.g. ReactDOMTestingFB exports) to React Native or a custom renderer; upgrading a custom reconciler where the config object changed shape and supportsTestSelectors silently fell back to falsy; running FB-style selector tests against a non-DOM renderer.","solutions":["Use a renderer that implements test selectors: the DOM renderer (react-dom) is the reference implementation where supportsTestSelectors is true","If you own the custom reconciler, implement the host-config test-selector methods (getInstanceFromNode, getTextContent, matchAccessibilityRole, isHiddenSubtree, getBoundingRect, setFocusIfFocusable, setupIntersectionObserver) and set supportsTestSelectors: true in the Reconciler config","Otherwise replace findAllNodes with your environment's query API (React Native test queries, testing-library queries, renderer.toJSON traversal)"],"exampleFix":"// before (custom reconciler, selectors unsupported)\nconst Reconciler = require('react-reconciler');\nmodule.exports = Reconciler({/* host config without test-selector methods */});\nfindAllNodes(root, [createRoleSelector('button')]); // throws\n\n// after\nconst Reconciler = require('react-reconciler');\nmodule.exports = Reconciler({\n  // ...host config...\n  supportsTestSelectors: true,\n  getInstanceFromNode(node) { /* return Fiber or null */ },\n  getTextContent(node) { /* return string */ },\n  // ...other required host methods\n});","handlingStrategy":"try-catch","validationCode":"// The flag is not publicly exported; detect by renderer identity\nfunction rendererSupportsTestSelectors(renderer: string): boolean {\n  return renderer === 'react-dom'; // Fabric/art/custom renderers re-export ReactFiberConfigWithNoTestSelectors\n}","typeGuard":null,"tryCatchPattern":"try {\n  const nodes = findAllNodes(hostRoot, selectors);\n} catch (e) {\n  if (e instanceof Error && e.message === 'Test selector API is not supported by this renderer.') {\n    // fall back to renderer-native queries (testing-library, RN TestRenderer)\n  } else throw e;\n}","preventionTips":["Treat the test-selector API as DOM-only unless your custom reconciler explicitly sets supportsTestSelectors: true with the full host-method set","Keep selector-based test helpers behind an abstraction so a non-DOM renderer can swap in native queries","When building a custom renderer, decide up front whether to implement the test-selector host surface (getInstanceFromNode, getBoundingRect, setupIntersectionObserver, ...)"],"tags":["test-selectors","renderer-support","custom-renderer","react-native"],"backgroundTag":"unsupported-renderer-capability","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}