Reputation: 2045
I'm developing an social apps whereby user can simply attach a website URL, and when other user click on it it will show a webpage within the apps.
I'm using react navigation, is there a way can achieve this ?
Upvotes: 5
Views: 10274
Reputation: 4879
Use react-native-webview.
Use WebView
.
Example from official link.
import React, { Component } from 'react';
import { WebView } from 'react-native-webview';
class MyWeb extends Component {
render() {
return (
<WebView
source={{uri: 'https://github.com/facebook/react-native'}}
style={{marginTop: 20}}
/>
);
}
}
It will be better use WebView
in your component having header and basic control as backbutton and closebutton.
Upvotes: 7