{"record":{"id":"a8947c6fb2650af0","repo":"facebook/react","slug":"reactart-does-not-support-the-type-type","errorCode":null,"errorMessage":"ReactART does not support the type \"${type}\"","messagePattern":"ReactART does not support the type \"(.+?)\"","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/react-art/src/ReactFiberConfigART.js","lineNumber":297,"sourceCode":"      instance._applyProps = applyGroupProps;\n      break;\n    case TYPES.SHAPE:\n      instance = Mode.Shape();\n      instance._applyProps = applyShapeProps;\n      break;\n    case TYPES.TEXT:\n      instance = Mode.Text(\n        props.children,\n        props.font,\n        props.alignment,\n        props.path,\n      );\n      instance._applyProps = applyTextProps;\n      break;\n  }\n\n  if (!instance) {\n    throw new Error(`ReactART does not support the type \"${type}\"`);\n  }\n\n  instance._applyProps(instance, props);\n\n  return instance;\n}\n\nexport function cloneMutableInstance(instance, keepChildren) {\n  return instance;\n}\n\nexport function createTextInstance(\n  text,\n  rootContainerInstance,\n  internalInstanceHandle,\n) {\n  return text;\n}","sourceCodeStart":279,"sourceCodeEnd":315,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-art/src/ReactFiberConfigART.js#L279-L315","documentation":"react-art implements a host config for React with exactly four host element types: ClippingRectangle, Group, Shape, and Text (the TYPES constants in the createInstance switch). When React asks the renderer to create a host instance for any other type string, the switch falls through with instance still undefined and the renderer throws ReactART does not support the type \"<type>\". The message echoes the offending type so you can see exactly which element leaked in.","triggerScenarios":"Rendering a DOM element (<div>, <p>, <svg>) or any unknown lowercase tag inside a react-art <Surface>; using a typo'd ART primitive (<Rekt> instead of <Rect>-style Shape usage); a library component that internally renders HTML assuming a DOM renderer while mounted under the ART renderer.","commonSituations":"Mixing DOM JSX into ART trees when adopting react-art for canvas rendering; sharing component code between DOM and ART renderers; version changes where a previously supported type (e.g. older Image support) was removed from the switch.","solutions":["Render only ART primitives (Surface > ClippingRectangle/Group/Shape/Text) inside the ART tree","Replace DOM elements with ART equivalents: <Text> for text, <Shape> with paths for graphics instead of <div>/<svg>","If you need DOM alongside ART, keep them in separate subtrees: DOM-rendered components outside <Surface>, ART content inside it","Search the thrown type string in your JSX to find the offending element (the message includes it verbatim)"],"exampleFix":"// before\n<Surface width={300} height={300}>\n  <div className=\"label\">Hello</div>\n</Surface>\n\n// after\n<Surface width={300} height={300}>\n  <Text font=\"13px sans-serif\" alignment=\"center\">Hello</Text>\n</Surface>","handlingStrategy":"validation","validationCode":"// Dev-time guard: validate the element type before it reaches the ART renderer\nimport {Children, isValidElement} from 'react';\n\nconst ART_TYPES = new Set(['ClippingRectangle', 'Group', 'Shape', 'Text']);\n\nfunction assertArtChildren(children) {\n  Children.forEach(children, child => {\n    if (isValidElement(child) && typeof child.type === 'string' && !ART_TYPES.has(child.type)) {\n      throw new Error(`Non-ART element <${child.type}> cannot render inside <Surface>`);\n    }\n  });\n}","typeGuard":"const ART_TYPES = new Set(['ClippingRectangle', 'Group', 'Shape', 'Text']);\nconst isSupportedArtType = (type: unknown): type is string =>\n  typeof type === 'string' && ART_TYPES.has(type);","tryCatchPattern":null,"preventionTips":["Keep DOM and ART subtrees strictly separate; only ART primitives under <Surface>","Type helper components so only ART components can be passed as children","Fail fast in dev with a children-type assertion under <Surface>"],"tags":["react-art","renderer","unknown-element-type","host-config"],"backgroundTag":"unsupported-element-type","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}