MCPcopy Index your code
hub / github.com/codeaashu/claude-code / createInstance

Function createInstance

src/ink/reconciler.ts:331–359  ·  view source on GitHub ↗
(
    originalType: ElementNames,
    newProps: Props,
    _root: DOMElement,
    hostContext: HostContext,
    internalHandle?: unknown,
  )

Source from the content-addressed store, hash-verified

329 },
330 shouldSetTextContent: () => false,
331 createInstance(
332 originalType: ElementNames,
333 newProps: Props,
334 _root: DOMElement,
335 hostContext: HostContext,
336 internalHandle?: unknown,
337 ): DOMElement {
338 if (hostContext.isInsideText && originalType === 'ink-box') {
339 throw new Error(`<Box> can't be nested inside <Text> component`)
340 }
341
342 const type =
343 originalType === 'ink-text' && hostContext.isInsideText
344 ? 'ink-virtual-text'
345 : originalType
346
347 const node = createNode(type)
348 if (COMMIT_LOG) _createCount++
349
350 for (const [key, value] of Object.entries(newProps)) {
351 applyProp(node, key, value)
352 }
353
354 if (isDebugRepaintsEnabled()) {
355 node.debugOwnerChain = getOwnerChain(internalHandle)
356 }
357
358 return node
359 },
360 createTextInstance(
361 text: string,
362 _root: DOMElement,

Callers 1

getInstanceFunction · 0.85

Calls 5

createNodeFunction · 0.85
applyPropFunction · 0.85
isDebugRepaintsEnabledFunction · 0.85
getOwnerChainFunction · 0.85
entriesMethod · 0.80

Tested by

no test coverage detected