{"record":{"id":"1d0ead435cde4a44","repo":"facebook/react","slug":"argument-appears-to-not-be-a-reactcomponent-keys","errorCode":null,"errorMessage":"Argument appears to not be a ReactComponent. Keys: ${keys}","messagePattern":"Argument appears to not be a ReactComponent\\. Keys: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/react-reconciler/src/ReactFiberReconciler.js","lineNumber":167,"sourceCode":"\n  if (fiber.tag === ClassComponent) {\n    const Component = fiber.type;\n    if (isLegacyContextProvider(Component)) {\n      return processChildContext(fiber, Component, parentContext);\n    }\n  }\n\n  return parentContext;\n}\n\nfunction findHostInstance(component: Object): PublicInstance | null {\n  const fiber = getInstance(component);\n  if (fiber === undefined) {\n    if (typeof component.render === 'function') {\n      throw new Error('Unable to find node on an unmounted component.');\n    } else {\n      const keys = Object.keys(component).join(',');\n      throw new Error(\n        `Argument appears to not be a ReactComponent. Keys: ${keys}`,\n      );\n    }\n  }\n  const hostFiber = findCurrentHostFiber(fiber);\n  if (hostFiber === null) {\n    return null;\n  }\n  return getPublicInstance(hostFiber.stateNode);\n}\n\nfunction findHostInstanceWithWarning(\n  component: Object,\n  methodName: string,\n): PublicInstance | null {\n  if (__DEV__) {\n    const fiber = getInstance(component);\n    if (fiber === undefined) {","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-reconciler/src/ReactFiberReconciler.js#L149-L185","documentation":"findHostInstance got an object that has neither an internal fiber link nor a render method — it is not a React class component instance at all. React lists the argument's keys in the message to help identify what was actually passed.","triggerScenarios":"ReactDOM.findDOMNode called with a DOM node (e.g. a ref.current you already have), a plain object, a function-component (which has no instance), a memo/forwardRef wrapper object, or a component type instead of a mounted instance.","commonSituations":"Double resolution: passing ref.current into findDOMNode; passing the component class/function instead of an instance; wrapping findDOMNode around host elements or foreign objects.","solutions":["If you already hold a DOM node (ref.current), use it directly — no findDOMNode needed","Pass the mounted class instance obtained via a ref (ref.current is the instance for class children)","For function components, attach a ref to the host element they render instead of findDOMNode","Check the argument with a guard (typeof x.render === 'function') before calling in defensive code"],"exampleFix":"// before\nconst node = findDOMNode(this.inputRef.current); // inputRef.current is already a DOM node -> throws\n\n// after\nconst node = this.inputRef.current; // use the DOM node directly","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"function isReactClassInstance(x: unknown): x is React.Component {\n  return (\n    x != null &&\n    typeof x === 'object' &&\n    typeof (x as any).render === 'function' &&\n    typeof (x as any).setState === 'function'\n  );\n}","tryCatchPattern":null,"preventionTips":["Never pass a DOM node, a component type, or a memo/forwardRef wrapper to findDOMNode","If ref.current is already a DOM node, use it directly","For function components, put a ref on the host element they render","Type shared helpers so only class instances can reach findDOMNode"],"tags":["react","finddomnode","invalid-argument","refs"],"backgroundTag":"finddomnode-invalid-argument","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}