Create WebView in react-native expo


I want to display in a webview like image below:


How to do it … ?


We will make two step:

  • Create web_fahmi filename
  • Modify App.js

Create web_fahmi

Create web_fahmi.js filename under views folder and insert this code:

import React, { Component } from 'react';
import { WebView } from 'react-native';

class WebFahmi extends Component {
  render() {
    return (
        source={{ uri: '' }}
        style={{ marginTop: 20 }}
export default WebFahmi;


source is webview props that used to load static HTML or URI

Modify App.js

Open App.js file and modify like this code below:

import React from 'react';
import WebFahmi  from './views/web_fahmi';

const App = () => {
   return (
    <WebFahmi />

export default App;


import WebFahmi from ‘./views/web_fahmi’, this code mean that i import WebFahmi Class from web_fahmi.js file

Thanks For Reading

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *