Tuesday, 15 September 2020

Webview in react native

 Create Project....................................

Cmd : npx react-native init Projectname




Webview -------------------------------------------

https://blog.logrocket.com/the-complete-guide-to-react-native-webview/

Cmd

yarn add react-native-webview

npx react-native link react-native-webview




//This is an example code to understand WebView// 


import React, { Component } from 'react';

//import react in our code. 


import { WebView } from "react-native-webview";

//import all the components we are going to use. 


export default class App extends Component {

  render() {

    return (

       <WebView

        source={{uri: 'https://eleader.in/'}}

        style={{marginTop: 0}}

      />

    );

  }



add this code

android/src/AndroidManifest.xml


 android:icon="@mipmap/ic_launcher" After

 android:usesCleartextTraffic="true"

-----------------------------------------------------------

No comments: