MCPcopy
hub / github.com/remix-run/react-router / render

Method render

packages/create-react-router/prompts-text.ts:232–283  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

230 }
231
232 render() {
233 if (this.closed) return;
234 if (!this.firstRender) {
235 if (this.outputError)
236 this.out.write(
237 cursor.down(lines(this.outputError, this.out.columns) - 1) +
238 clear(this.outputError, this.out.columns),
239 );
240 this.out.write(clear(this.outputText, this.out.columns));
241 }
242 super.render();
243 this.outputError = "";
244
245 let prefix = " ".repeat(strip(this.label).length);
246
247 this.outputText = [
248 "\n",
249 this.label,
250 " ",
251 this.msg,
252 this.done
253 ? ""
254 : this.hint
255 ? (this.out.columns < 80 ? "\n" + " ".repeat(8) : "") +
256 color.dim(` (${this.hint})`)
257 : "",
258 "\n" + prefix,
259 " ",
260 this.done ? color.dim(this.rendered) : this.rendered,
261 ].join("");
262
263 if (this.error) {
264 this.outputError += ` ${color.redBright(
265 (shouldUseAscii() ? "> " : "▶ ") + this.errorMsg,
266 )}`;
267 }
268
269 this.out.write(
270 erase.line +
271 cursor.to(0) +
272 this.outputText +
273 cursor.save +
274 this.outputError +
275 cursor.restore +
276 cursor.move(
277 this.placeholder
278 ? (this.rendered.length - 9) * -1
279 : this.cursorOffset,
280 0,
281 ),
282 );
283 }
284}

Callers 14

constructorMethod · 0.95
resetMethod · 0.95
abortMethod · 0.95
submitMethod · 0.95
nextMethod · 0.95
_Method · 0.95
deleteMethod · 0.95
deleteForwardMethod · 0.95
firstMethod · 0.95
lastMethod · 0.95
leftMethod · 0.95
rightMethod · 0.95

Calls 5

linesFunction · 0.90
clearFunction · 0.90
stripFunction · 0.90
shouldUseAsciiFunction · 0.90
downMethod · 0.45

Tested by

no test coverage detected