Skip to content

Commit

Permalink
allow JS repl with initialLines
Browse files Browse the repository at this point in the history
  • Loading branch information
seveibar committed Mar 11, 2022
1 parent 6769780 commit 6f66a21
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "awesome-react-repl",
"version": "1.0.1",
"version": "1.0.2",
"main": "dist/ReactReplJS.js",
"dependencies": {
"pretty-format": "^26.6.2",
Expand Down
3 changes: 2 additions & 1 deletion src/ReactReplJS.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ export const ReactReplJS = ({
tabs,
selectedTab,
onChangeTab,
initialLines = [],
initiallyExecute = [],
height,
submitCodeRef = null,
}) => {
const [lines, setLines] = useState([])
const [lines, setLines] = useState(initialLines)

const onSubmit = async (execLine) => {
const newLines = lines.concat([{ type: "input", value: execLine }])
Expand Down

0 comments on commit 6f66a21

Please sign in to comment.