rage-framework-example/apps/browser/src/App.tsx

23 lines
512 B
TypeScript
Raw Normal View History

2024-06-13 20:12:40 +00:00
import { fw } from 'rage-fw-cef'
2024-06-15 14:41:45 +00:00
import { useEffect, useState } from 'react'
2024-06-13 20:12:40 +00:00
2024-06-12 22:59:21 +00:00
function App() {
2024-06-15 14:41:45 +00:00
const [data, setData] = useState('')
2024-06-13 20:12:40 +00:00
useEffect(() => {
2024-09-30 18:40:58 +00:00
fw.event.register('customCefEvent', async ([test]) => {
setData(p => p + ' ' + test)
return 'from cef'
2024-06-13 20:12:40 +00:00
})
}, [])
return (
2024-09-30 18:40:58 +00:00
<div style={{ width: '100%', color: 'white', textAlign: 'center' }}>
2024-06-13 20:12:40 +00:00
<h1>Hello World!</h1>
2024-06-15 14:41:45 +00:00
<h2>{data}</h2>
2024-09-30 18:40:58 +00:00
</div>
2024-06-13 20:12:40 +00:00
)
2024-06-12 22:59:21 +00:00
}
export default App