jonmbake / react-terminal-ui

A terminal react component with support for light and dark modes.
https://jonmbake.github.io/react-terminal-ui/demo/
MIT License
212 stars 32 forks source link

Update API to Use Child Components Instead of `lineData` prop #3

Closed jonmbake closed 2 years ago

jonmbake commented 3 years ago

Is your feature request related to a problem? Please describe. The current API is not great. lineData is passed as a prop, which the Terminal component renders as child props.

Describe the solution you'd like A better design would be for the Terminal component to take terminal lines as a child component, something like:

<Terminal name='React Terminal Usage Example' colorMode={ ColorMode.Light }>
  <TerminalOutput>Welcome to the React Terminal UI Demo!</TerminalOutput>
  <TerminalInput>Some input received</TerminalInput>
</Terminal>

Describe alternatives you've considered Leave as is. The existing solution works. However, it is not in line with best practices for React.