Skip to content
๊ฐœ๋ฐœ ๋ฌธ์„œ

NITRO WEBVIEW / REACT NATIVE

Nitro +
WebView = ๐Ÿš€

Nitro Modules๋กœ ๋งŒ๋“  React Native WebView. ์ต์ˆ™ํ•œ ์›น ์ฝ˜ํ…์ธ ๋ฅผ ํƒ€์ž…์ด ์žˆ๋Š” ์ฝœ๋ฐฑ๊ณผ ๋„ค์ดํ‹ฐ๋ธŒ API๋กœ ์—ฐ๊ฒฐํ•˜์„ธ์š”.

iOS ยท Android ยท New Architecture

TypeScriptNitro ModulesWKWebViewAndroid WebViewMIT licensed

WEB โ†’ REACT NATIVE

์ฒซ ํ™”๋ฉด๋ถ€ํ„ฐ ์—ฐ๊ฒฐ๊นŒ์ง€.

WebView๋ฅผ ๋ Œ๋”๋งํ•˜๊ณ  ํŽ˜์ด์ง€์˜ ๋ฉ”์‹œ์ง€๋ฅผ ๋ฐ›์œผ์„ธ์š”. ์ฝœ๋ฐฑ์€ callback()์œผ๋กœ ๊ฐ์Œ‰๋‹ˆ๋‹ค.

์ฒซ WebView ๋งŒ๋“ค๊ธฐ
Screen.tsxReact Native
tsx
import { 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 web

DOCUMENTATION

๋งŒ๋“ค๋ ค๋Š” ๊ธฐ๋Šฅ๋ถ€ํ„ฐ ์‹œ์ž‘ํ•˜์„ธ์š”.

ํ”Œ๋žซํผ๋งˆ๋‹ค ๋‹ค๋ฅธ ๋™์ž‘, ๋ฌธ์„œ์—์„œ ๋จผ์ € ํ™•์ธํ•˜์„ธ์š”.

ํ”Œ๋žซํผ ์ง€์› ํ™•์ธ

MIT licensed ยท Built with Nitro Modules