React Native WebView is a component which is use to render the web page into mobile version. This is supported by Android and IOs both. WebView is very useful as you can open any web link in mobile app itself.

Syntax

<WebView source={{uri: 'https://rrtutors.com'}}/>

Example

import React, {Component} from 'react';

import {View, StyleSheet, Text} from 'react-native';

import {WebView} from 'react-native-web';

 

export default class WebviewExample extends Component {

  render() {

    return (

      <View style={ss.container}>

        <View style={ss.header}>

          <Text>React Native Webview Example </Text>

        </View>

        <View style={ss.body}>

          <WebView

            source={{

              uri: 'https://rrtutors.com/',

            }}

          />

        </View>

      </View>

    );

  }

}

 

const ss = StyleSheet.create({

  container: {

    backgroundColor: '#FAFAFA',

    flex: 1,

  },

  header: {

    alignItems: 'center',

    padding: 10,

    backgroundColor: 'cyan',

  },

  body: {

    backgroundColor: 'grey',

    padding: 16,

    flex: 1,

  },

  textinputs: {

    color: 'white',

    borderBottomColor: 'white',

    borderBottomWidth: 2,

    fontSize: 22,

  },

});

 

 


Subscribe For Daily Updates