usage sample

This commit is contained in:
Oleksandr Honcharov
2024-06-15 17:41:45 +03:00
parent 0138af71c0
commit 34dd2172c7
3 changed files with 12 additions and 7 deletions
+6 -4
View File
@@ -1,18 +1,20 @@
import { fw } from 'rage-fw-cef'
import { useEffect } from 'react'
import { useEffect, useState } from 'react'
function App() {
const [data, setData] = useState('')
useEffect(() => {
fw.event.register('customCefEvent', ([test]) => {
console.log(test)
return ''
setData(test)
return 'response from cef'
})
}, [])
return (
<>
<h1>Hello World!</h1>
<h2>{data}</h2>
</>
)
}