mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-04-25 12:19:10 +00:00
24 lines
450 B
JavaScript
24 lines
450 B
JavaScript
import * as React from 'react'
|
|
import RPC from '../config/rpc'
|
|
|
|
export default class TestRPC extends React.Component {
|
|
static async getInitialProps (ctx) {
|
|
return {
|
|
// hello: await RPC.hello('world')
|
|
}
|
|
}
|
|
|
|
componentDidMount () {
|
|
window.$RPC = RPC
|
|
}
|
|
|
|
componentDidCatch (error, errorInfo) {
|
|
if (error) {
|
|
console.log(error, errorInfo)
|
|
}
|
|
}
|
|
|
|
render () {
|
|
return <div>hello, { this.props.hello }</div>
|
|
}
|
|
}
|