An open API service indexing awesome lists of open source software.

https://github.com/seamapi/react-repl

React component for creating a REPL or interactive command line interface
https://github.com/seamapi/react-repl

react react-component repl

Last synced: 5 months ago
JSON representation

React component for creating a REPL or interactive command line interface

Awesome Lists containing this project

README

        

# (Awesome) React Repl

Display or interact with a REPL (Read Eval Print Loop). Create an interactive terminal for Python,
Javascript or whatever in React.

[Try it out](https://seamapi.github.io/react-repl/?path=/story/reactrepljs--main)

![promises](https://user-images.githubusercontent.com/1910070/107008052-50cc7f80-6761-11eb-8ccc-61f79167f24b.png)
![error](https://user-images.githubusercontent.com/1910070/107008157-7194d500-6761-11eb-8816-03111757ccf4.png)

## Usage

`npm install awesome-react-repl`

### Javascript REPL

```javascript
import { ReactReplJS } from "awesome-react-repl"

const JavascriptRepl = () => {
return (

)
}
```

### General-Purpose REPL UI

```javascript
import { ReactReplView } from "awesome-react-repl"

const GeneralPurposeReplUI = () => {
return (

)
}
```

## Advanced Javascript REPL Usage

```javascript
import { useReactReplJS } from "awesome-react-repl"

const JavascriptRepl = () => {
const { submitCode, ReactRepl } = useReactReplJS()
return (



submitCode('alert(`Button pressed! a=${a}! This will appear in the REPL!`)')}>Alert!

)
}
```

## Development

1. Run `yarn install`
2. Run `yarn storybook`