in this chapter, we will learn how to use webview. it is used when you want to render web page to your mobile app inline.
using webview
the homecontainer will be a container component.
app.js
import react, { component } from 'react'
import webviewexample from './web_view_example.js'
const app = () => {
return (
<webviewexample/>
)
}
export default app;
let us create a new file called webviewexample.js inside the src/components/home folder.
web_view_example.js
import react, { component } from 'react'
import { view, webview, stylesheet }
from 'react-native'
const webviewexample = () => {
return (
<view style = {styles.container}>
<webview
source = {{ uri:
'https://www.google.com/?gws_rd=cr,ssl&ei=siccv9_efqqk6asa3zaaba#q=tutorialspoint' }}
/>
</view>
)
}
export default webviewexample;
const styles = stylesheet.create({
container: {
height: 350,
}
})
the above program will generate the following output.