Skip to content

Latest commit

 

History

History
44 lines (30 loc) · 1.02 KB

README.md

File metadata and controls

44 lines (30 loc) · 1.02 KB

React Interactive ClojureScript

Displays highlighted ClojureScript that can be run in the browser

Uses react-syntax-highlighter and eval-cljs

npm i react-interactive-cljs
"use client"
import { CodeBlock } from "react-interactive-cljs"

export function Page() {
    return (<CodeBlock>{`(println "Hello")
(+ 2 2)`}</CodeBlock>)
)

The code above will render like the image below

After clicking the "Run" button it will render like the image below

Accepts the same props as react-syntax-highlighter plus:

  • language defaults to "clojure"
  • allowEval a boolean that defaults to true if the language is "clojure".

"use client"
import { Repl } from "react-interactive-cljs"

export function Page() {
    return (<Repl defaultInput={`"Hello, World!"`} />)
)