Use React and CSS to build UI interfaces on canvas
Document | 中文文档 | Live DEMO | DEMO Code
$ yarn add revas react
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')
)
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" />
}
}
- https://github.com/pinqy520/revas-wxgame-example
- https://github.com/pinqy520/revas-bytegame-example
- Vue - huruji/vuvas by @huruji