revas
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published


npm version

Use React and CSS to build UI interfaces on canvas

Document | 中文文档 | Live DEMO | DEMO Code

Install

$ yarn add revas react

Usage

Render to a DOM

import React from 'react'
import {render, View, Text} from 'revas'

render(
  <View style={{ flex: 1 }}>
    <Text style={{ fontSize: 20 }}>Revas</Text>
  </View>,
  document.getElementById('container')
)

Edit purple-browser-h56ht

Render to a DOM rendered by React

import React from 'react'
import {render, View, Text} from 'revas'

export class Widget extends React.Component {
  componentDidMount() {
    this.app = render(
      <View style={{ flex: 1 }}>
        <Text style={{ fontSize: 20 }}>Revas</Text>
      </View>,
      document.getElementById('container'),
      this
    )
  }
  componentDidUpdate() {
    this.app.update()
  }
  componentWillUnmount() {
    this.app.unmount()
  }
  render() {
    return <div id="container" />
  }
}

Edit reverent-river-vbypp

Render to a custom canvas api

DEMO

Other Framework

Package Sidebar

Install

npm i revas

Weekly Downloads

11

Version

1.0.3

License

MIT

Unpacked Size

342 kB

Total Files

73

Last publish

Collaborators

  • pinqy520