A online playground for react, inspired by vue/repl and unocss/playground.
Thanks to the open source of vue/repl and its maintainers, this project is built to provide a similar experience for react.
React REPL as a React component.
vite v6.0.0+
Make sure your vite version is above 6. If not, there may be wasm errors in the local environment. However, it does not affect the effect after packaging. For details, you can check here.
import { Repl, useReplStore } from '@zhangmo8/repl-react'
const Demo = () => {
const { state, setState } = useReplStore()
return (
<div>
<Repl />
<p>Code: {state.code}</p>
</div>
)
}