Archived
usage sample
This commit is contained in:
@@ -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>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user