Skip to content

Latest commit

 

History

History
34 lines (23 loc) · 1.02 KB

README.md

File metadata and controls

34 lines (23 loc) · 1.02 KB

repl-react

NPM dev or peer Dependency Version

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.

@zhangmo8/repl-react

React REPL as a React component.

Environment Support

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.

Basic Usage

import { Repl, useReplStore } from '@zhangmo8/repl-react'

const Demo = () => {
  const { state, setState } = useReplStore()
  return (
    <div>
      <Repl />
      <p>Code: {state.code}</p>
    </div>
  )
}