NITRO WEBVIEW / REACT NATIVE
A React Native WebView built on Nitro Modules. Connect your web content with typed callbacks and native APIs.
iOS Β· Android Β· New Architecture
WEB β REACT NATIVE
Render a WebView and receive a message from the page. Wrap event handlers with callback().
Build your first WebViewimport { NitroWebView, callback } from 'nitro-webview'
const html = `
<h1>Hello, Nitro</h1>
<script>
window.ReactNativeWebView.postMessage('hello from the web')
</script>
`
export default function Screen() {
return (
<NitroWebView
style={{ flex: 1 }}
source={{ html, baseUrl: 'https://app.example.com' }}
onMessage={callback(({ nativeEvent }) => {
console.log(nativeEvent.data)
})}
/>
)
}onMessagehello from the webDOCUMENTATION
Different platforms. Explicit behavior.
Check platform support