MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / createRoot

Function createRoot

source code/ink/root.ts:131–159  ·  view source on GitHub ↗
({
  stdout = process.stdout,
  stdin = process.stdin,
  stderr = process.stderr,
  exitOnCtrlC = true,
  patchConsole = true,
  onFrame,
}: RenderOptions = {})

Source from the content-addressed store, hash-verified

129 * Like react-dom's createRoot — call root.render() to mount a tree.
130 */
131export async function createRoot({
132 stdout = process.stdout,
133 stdin = process.stdin,
134 stderr = process.stderr,
135 exitOnCtrlC = true,
136 patchConsole = true,
137 onFrame,
138}: RenderOptions = {}): Promise<Root> {
139 // See wrappedRender — preserve microtask boundary from the old WASM await.
140 await Promise.resolve()
141 const instance = new Ink({
142 stdout,
143 stdin,
144 stderr,
145 exitOnCtrlC,
146 patchConsole,
147 onFrame,
148 })
149
150 // Register in the instances map so that code that looks up the Ink
151 // instance by stdout (e.g. external editor pause/resume) can find it.
152 instances.set(stdout, instance)
153
154 return {
155 render: node => instance.render(node),
156 unmount: () => instance.unmount(),
157 waitUntilExit: () => instance.waitUntilExit(),
158 }
159}
160
161const getOptions = (
162 stdout: NodeJS.WriteStream | RenderOptions | undefined = {},

Callers

nothing calls this directly

Calls 5

renderMethod · 0.95
unmountMethod · 0.95
waitUntilExitMethod · 0.95
resolveMethod · 0.80
setMethod · 0.80

Tested by

no test coverage detected