Skip to content

zyyv/repl-react

 
 

Repository files navigation

repl-react

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.

Basic Usage

// vite.config.ts
import { defineConfig } from 'vite'
export default defineConfig({
  optimizeDeps: {
    exclude: ['@zhangmo8/repl-react'],
  },
  // ...
})
import { Repl, useReplStore } from '@zhangmo8/repl-react'

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

About

repl like react

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 77.6%
  • CSS 19.0%
  • HTML 3.4%