(
originalType: ElementNames,
newProps: Props,
_root: DOMElement,
hostContext: HostContext,
internalHandle?: unknown,
)
| 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, |
no test coverage detected