Archived
upd
- added all non-jumping calls (cef <=> client, client <=> server) - added @ragempcommunity types (todo)
This commit is contained in:
@@ -1,20 +1,18 @@
|
||||
import { fw } from 'rage-fw-cef'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { rpc } from 'rpc'
|
||||
|
||||
function App() {
|
||||
const [data, setData] = useState('')
|
||||
const [data, setData] = useState<unknown>('')
|
||||
|
||||
useEffect(() => {
|
||||
fw.event.register('customCefEvent', async ([test]) => {
|
||||
setData(p => p + ' ' + test)
|
||||
return 'from cef'
|
||||
})
|
||||
rpc.callClient('cefReady', [])
|
||||
rpc.register('customCefEvent', args => setData(args))
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div style={{ width: '100%', color: 'white', textAlign: 'center' }}>
|
||||
<h1>Hello World!</h1>
|
||||
<h2>{data}</h2>
|
||||
<h2>{data!.toString()}</h2>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user