- added all non-jumping calls (cef <=> client, client <=> server)
- added @ragempcommunity types (todo)
This commit is contained in:
2024-10-03 18:59:41 +01:00
parent 092693acb5
commit f8dd4d9fce
14 changed files with 162 additions and 103 deletions
+5 -7
View File
@@ -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>
)
}