Render a scrollable terminal log in your ink app
npm install ink-console --save
import {h, render} from 'ts-ink';
import Console from 'ink-console';
import Counter from './Counter';
render(
<div>
<Counter />
<br />
<Console lines={20} />
</div>,
);
import {h, render} from 'ts-ink';
import Console, {LogCatcher} from 'ink-console';
import Counter from './Counter';
// defining the log catcher outside the component
// lets you render the same global console.log in
// multiple separate locations
// e.g. you can preserve the log even if it is not always visible
const logCatcher = new LogCatcher();
render(
<div>
<Counter />
<br />
<Console lines={20} logCatcher={logCatcher} />
</div>,
);
MIT