https://github.com/windrunnermax/reactlive
Real-time preview of React components
https://github.com/windrunnermax/reactlive
Last synced: about 1 year ago
JSON representation
Real-time preview of React components
- Host: GitHub
- URL: https://github.com/windrunnermax/reactlive
- Owner: WindRunnerMax
- Created: 2023-09-07T14:28:46.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-07-12T11:24:55.000Z (almost 2 years ago)
- Last Synced: 2025-03-25T20:33:32.537Z (about 1 year ago)
- Language: TypeScript
- Homepage: https://windrunnermax.github.io/ReactLive/
- Size: 24.4 MB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# React Live
GitHub
|
Playground
|
DEMO
|
BLOG
## Usage
```bash
$ pnpm add react-live-runtime -E
```
```js
// ./example/index.tsx
const sandbox = withSandbox({ React, console, alert, ...Arco });
const compiledCode = compileWithSucrase("
" + code + "");
const Component = renderWithDependency(compiledCode, sandbox) as JSX.Element;
ReactDOM.render(Component, el);
```
## Develop
```bash
$ npm i -g pnpm@8.11.0
$ pnpm install --frozen-lockfile
$ npx husky install
$ chmod 755 .husky/pre-commit
$ pnpm run dev
```