Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ Properties you can pass to the console element
| log | (...messages: any)=>void | Log messages to the console. If string, print the value, otherwise, print the JSON value of the message.
| logX | (type: string, ...messages: any)=>void | Log messages of a particular type to the console. The messages will be given the class `react-console-message-{type}`.
| return | ()=>void | Signal the current command has finished and a new prompt should be displayed.
| clearScreen | ()=>void | Clear the visible log in the console. Does not clear command history.


## Awknoledgements
Expand Down
7 changes: 5 additions & 2 deletions src/react-console.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ export default class extends React.Component<ConsoleProps,ConsoleState> {
70: this.forwardChar,
// C-b
66: this.backwardChar,
// C-l TODO
//76: this.clearScreen,
// C-l
76: this.clearScreen,
// C-p
80: this.previousHistory,
// C-n
Expand Down Expand Up @@ -588,6 +588,9 @@ export default class extends React.Component<ConsoleProps,ConsoleState> {
}, this.scrollToBottom);
}
}
clearScreen = () => {
this.setState({ log: [] });
}
nonIncrementalReverseSearchHistory = () => {
// TODO
}
Expand Down