About Lesson
In this React Native lesson we are going to learn about React Native WebView, the WebView component renders HTML content in a native web View component. Note that this includes CSS, JavaScript, and anything else you can typically display in a web browser (subject to whatever limitations might exist on a given platform).
Installation
First of all you need to install this component.
1 |
expo install react-native-webview |
This is our ReactWeb.js, and you can see that we have used react webview component, and you need to add the source of the website.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
import React from 'react' import {View} from 'react-native'; import { WebView } from 'react-native-webview'; function ReactWeb() { return ( <WebView source={{ uri : "https://geekscoders.com/" }} /> ) } export default ReactWeb |
This is our App.js.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
import React from 'react'; import ReactWeb from './components/ReactWeb'; function App() { return ( <ReactWeb/> ); } export default App |
Run your application and this is the result.