# @race-ui/utils

> react code live run

Latest version **0.0.8** (published 2021-09-30) · ISC license · 0 weekly downloads

## Install

```sh
npm install @race-ui/utils
pnpm add @race-ui/utils
yarn add @race-ui/utils
bun add @race-ui/utils
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.8 |
| Published | 2021-09-30 |
| First published | 2021-09-26 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 188 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | zhangkun |
| Maintainers | zhang123456 |

## Links

- npm: https://www.npmjs.com/package/@race-ui/utils
- Repository: https://zzu1@bitbucket.org/zzu1/race-ui
- Homepage: https://bitbucket.org/zzu1/race-ui#readme
- Issues: https://bitbucket.org/zzu1/race-ui/issues
- npm.io page: https://npm.io/package/@race-ui/utils

## Recent versions

- 0.0.8 (latest) — 2021-09-30
- 0.0.7 — 2021-09-30
- 0.0.6 — 2021-09-26
- 0.0.5 — 2021-09-26

## README

# @race-ui/react-live

支持静态react代码，在线编辑和运行。

### 安装

```shell
npm install @race-ui/react-live --save

# 其他依赖安装
npm install @babel/standalone codemirror react-codemirror2 acorn escodegen --save
```

### 使用

#### 引入
```javascript
import ReactLive from '@race-ui/react-live';

import 'codemirror/lib/codemirror.css';
import 'codemirror/theme/material.css';
import '@race-ui/react-live/assets/index.css';
```

#### demo

```jsx
const Code = `
  class Demo extends React.Component {
    constructor(props) {
      super(props)
      this.state = {
        value: 'Hello11331!'
      }
      this.handleChange = this.handleChange.bind(this)
    }
    // name
    handleChange(event) {
      this.setState({ value: event.target.value });
    }
    render() {
      var value = this.state.value;
      return (
        <div>
          <h1>Hello this is a Online Editor</h1>
          <input type="text" value={value} onChange={this.handleChange} />
          <p>{value}</p>
        </div>
      );
    }
  }
  // ReactDOM.render(<Demo />, mountNode);
`;

ReactDOM.render(<ReactLive code={Code} />, mountNode);
```

---
_Source: https://npm.io/package/@race-ui/utils · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
